-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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
[v10.x backport] http: send connection: close when closing conn #26627
[v10.x backport] http: send connection: close when closing conn #26627
Conversation
HTTP/1.1 mandates connections which do not support keep-alive and close the connection send the connection: close header, see https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.10 This page also provides more information: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Connection I understand that HTTP/1.1 defaults to keep-alive - and that the Connection: close header is required when closing a connection. This adds the Connection: close header in the 400 responses sent on client errors. PR-URL: nodejs#26467
It might be better to also open this for 11.x land that first, wait a couple of releases and then also land this. |
New CI: https://ci.nodejs.org/job/node-test-pull-request/22218/ cc: @nodejs/lts |
@lpinca @johanneswuerbach, is it possible that this change could cause ecosystem breakages? Just erring on the side of caution before landing this on v10.x. /cc @nodejs/lts |
@BethGriggs I don't think so as the socket is destroyed anyway. cc: @nodejs/http |
@BethGriggs as explained here #26467 (comment), I think this is mainly a bugfix to make node js http spec complaint and wouldn't expect any breakage as it merely adds a missing header. |
HTTP/1.1 mandates connections which do not support keep-alive and close the connection send the connection: close header, see https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.10 This page also provides more information: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Connection I understand that HTTP/1.1 defaults to keep-alive - and that the Connection: close header is required when closing a connection. This adds the Connection: close header in the 400 responses sent on client errors. Backport-PR-URL: #26627 PR-URL: #26467 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Landed on v10.x-staging |
Back-port of #26467 to v10
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes