Skip to content

feat: validate status code range in res.status() - #7358

Closed
mayank-dev-15 wants to merge 1 commit into
expressjs:masterfrom
mayank-dev-15:feat-status-code-validation
Closed

feat: validate status code range in res.status()#7358
mayank-dev-15 wants to merge 1 commit into
expressjs:masterfrom
mayank-dev-15:feat-status-code-validation

Conversation

@mayank-dev-15

Copy link
Copy Markdown

Fixes#5623. Validates that status codes are integers between 100 and 599. Throws TypeError for non-integer codes and RangeError for codes outside the valid HTTP status range.

Validates that status codes are integers between 100 and 599.
Throws TypeError for non-integer codes and RangeError for codes
outside the valid HTTP status range. Fixesexpressjs#5623.
@krzysdz

Copy link
Copy Markdown
Contributor

In #5623 (comment) there was an idea of introducing a new setting and there is already a PR which does this: #5856

@krzysdzkrzysdz closed this Jul 4, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[v5] Lock down valid status code ranges to 1xx through 5xx

2 participants

@mayank-dev-15@krzysdz