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

Projects
None yet
3 participants
@cjihrig
Contributor

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

@jasnell

jasnell approved these changes Feb 7, 2017

@cjihrig

This comment has been minimized.

Show comment
Hide comment
http: include provided status code in range error
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: #11221
Reviewed-By: James M Snell <jasnell@gmail.com>

@cjihrig cjihrig merged commit a4bb9fd into nodejs:master Feb 9, 2017

@cjihrig cjihrig deleted the cjihrig:err-msg branch Feb 9, 2017

@Trott Trott referenced this pull request Feb 14, 2017

Closed

test: refactor test-http-response-statuscode #11274

2 of 2 tasks complete

KryDos added a commit to KryDos/node that referenced this pull request Feb 25, 2017

http: include provided status code in range error
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 <jasnell@gmail.com>

@jasnell jasnell referenced this pull request Apr 4, 2017

Closed

8.0.0 Release Proposal #12220

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment