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

[v10.x backport] http: send connection: close when closing conn #26627

Closed

Conversation

johanneswuerbach
Copy link

Back-port of #26467 to v10

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines

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
@nodejs-github-bot nodejs-github-bot added http Issues or PRs related to the http subsystem. v10.x labels Mar 13, 2019
@lpinca
Copy link
Member

lpinca commented Mar 13, 2019

It might be better to also open this for 11.x land that first, wait a couple of releases and then also land this.

@johanneswuerbach
Copy link
Author

Thanks @lpinca , PR created #26646

@lpinca
Copy link
Member

lpinca commented Mar 14, 2019

@nodejs-github-bot
Copy link
Collaborator

@lpinca
Copy link
Member

lpinca commented Apr 5, 2019

New CI: https://ci.nodejs.org/job/node-test-pull-request/22218/

cc: @nodejs/lts

@BethGriggs
Copy link
Member

@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

@lpinca
Copy link
Member

lpinca commented Apr 8, 2019

@BethGriggs I don't think so as the socket is destroyed anyway.

cc: @nodejs/http

@johanneswuerbach
Copy link
Author

@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.

BethGriggs pushed a commit that referenced this pull request Apr 16, 2019
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>
@BethGriggs
Copy link
Member

Landed on v10.x-staging

@BethGriggs BethGriggs closed this Apr 16, 2019
@johanneswuerbach johanneswuerbach deleted the backport-26467 branch April 16, 2019 14:01
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants