GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||
GeezerVison is showing github.com — Allowing HEAD method to work with keep-alive by josephhackman · Pull Request #34231 · nodejs/node Conversation
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
It seems that the only tests failing are flakey. Is there additional action required on my part? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@josephhackman No action on your part is needed but since this is a fairly subtle change it'd be good to get at least one more sign-off from a @nodejs/http member. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Re-factoring to address PR comment. The logic here gets somewhat complicated with regards to the if-elseif block circa line 434. The goal of this PR is to prevent head requests from having their Content-Length or Content-Encoding headers cleared except when necessary, which is when the response code is 204 or 304. In trying to address comment, I'm balancing between a larger re-factor than absolutely needed and somewhat ugly control logic. Refs: nodejs#34231 (comment)
|
Just as a side note. HEAD requests have an edge case due to which many HTTP clients (including the node one) will always close the connection and ignore keep-alive. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
This isn't quite true. The node client will close a the connection on a HEAD response if neither the These headers are allowed by the HTTP standard, so this change should keep the node server just as compliant as it always was, while allowing any properly-implemented client to be substantially faster while sending many HEAD requests to collect metadata. On the other hand, it is possible that non-standards-compliant clients exist that would malfunction seeing these headers on a HEAD request. I think that's a minimal risk because most people don't implement their own HTTP client library, but many people do mess with the headers on their servers. This leads me to expect that clients tend to be standards-compliant, and if anything, hardened. Refs: https://tools.ietf.org/html/rfc7231#section-3.3 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
This needs another approval. I'm not comfortable in my own knowledge here to give the second one. @nodejs/http |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Fixes: nodejs#28438 PR-URL: nodejs#34231 Reviewed-By: James M Snell <[email protected]>
|
Landed in 7afa533 🎉 Thanks a lot for your contribution! |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Fixes: #28438 PR-URL: #34231 Reviewed-By: James M Snell <[email protected]>
Fixes: #28438 PR-URL: #34231 Reviewed-By: James M Snell <[email protected]>
|
I'm not convinced this was a good change. My HEAD methods with status 200 now send Seems to me the sensible default would have been |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
http server respond with inappropriate default headers forHEAD method
There was an error while loading. Please reload this page.