Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

http: include provided status code in range error #11221

Merged
merged 1 commit into from
Feb 9, 2017

Conversation

cjihrig
Copy link
Contributor

@cjihrig cjihrig commented Feb 7, 2017

ServerResponse#writeHead() coerces the user provided status code to a number and then performs a range check. If the check fails, a range error is thrown. The coerced status code is included in the error message. This commit uses the user provided status code instead. Hopefully, this will make the error message less confusing.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines
Affected core subsystem(s)

http

@cjihrig cjihrig added the semver-major PRs that contain breaking changes and should be released in the next major version. label Feb 7, 2017
@nodejs-github-bot nodejs-github-bot added the http Issues or PRs related to the http subsystem. label Feb 7, 2017
@cjihrig
Copy link
Contributor Author

cjihrig commented Feb 9, 2017

ServerResponse#writeHead() coerces the user provided status code
to a number and then performs a range check. If the check fails,
a range error is thrown. The coerced status code is included in
the error message. This commit uses the user provided status code
instead.

PR-URL: nodejs#11221
Reviewed-By: James M Snell <[email protected]>
@cjihrig cjihrig merged commit a4bb9fd into nodejs:master Feb 9, 2017
@cjihrig cjihrig deleted the err-msg branch February 9, 2017 17:49
krydos pushed a commit to krydos/node that referenced this pull request Feb 25, 2017
ServerResponse#writeHead() coerces the user provided status code
to a number and then performs a range check. If the check fails,
a range error is thrown. The coerced status code is included in
the error message. This commit uses the user provided status code
instead.

PR-URL: nodejs#11221
Reviewed-By: James M Snell <[email protected]>
@jasnell jasnell mentioned this pull request Apr 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
http Issues or PRs related to the http subsystem. semver-major PRs that contain breaking changes and should be released in the next major version.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants