Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 34.2k
http: send implicit headers on HEAD with no body#48108
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: send implicit headers on HEAD with no body #48108
Uh oh!
There was an error while loading. Please reload this page.
Conversation
If we respond to a HEAD request with a body, we ignore all writes. However, we must still include all implicit headers. Fixes a regressions introduced in nodejs#47732. Signed-off-by: Matteo Collina <[email protected]>
nodejs-github-bot commented May 21, 2023
Review requested:
|
| constserver=http.createServer(function(req,res){ | ||
| res.writeHead(200); | ||
| res.end(); | ||
| res.end('FAIL');// broken: sends FAIL from hot path. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was a spurious change introduced by the previous PR.
nodejs-github-bot commented May 21, 2023
test/parallel/test-http-head-response-has-no-body-end-implicit-headers.js Outdated Show resolvedHide resolved
Uh oh!
There was an error while loading. Please reload this page.
…-headers.js Co-authored-by: cjihrig <[email protected]>
nodejs-github-bot commented May 22, 2023
nodejs-github-bot commented May 24, 2023
gerrard00 commented May 25, 2023
Appreciate the fix, sorry for not catching that. |
nodejs-github-bot commented May 26, 2023
Commit Queue failed- Loading data for nodejs/node/pull/48108 ✔ Done loading data for nodejs/node/pull/48108 ----------------------------------- PR info ------------------------------------ Title http: send implicit headers on HEAD with no body (#48108) Author Matteo Collina (@mcollina) Branch mcollina:fix-regression-from-47732 -> nodejs:main Labels http, author ready, commit-queue-squash Commits 2 - http: send implicit headers on HEAD with no body - Update test/parallel/test-http-head-response-has-no-body-end-implicit… Committers 2 - Matteo Collina - GitHub PR-URL: https://github.com/nodejs/node/pull/48108 Reviewed-By: Colin Ihrig Reviewed-By: Robert Nagy Reviewed-By: Paolo Insogna Reviewed-By: Marco Ippolito ------------------------------ Generated metadata ------------------------------ PR-URL: https://github.com/nodejs/node/pull/48108 Reviewed-By: Colin Ihrig Reviewed-By: Robert Nagy Reviewed-By: Paolo Insogna Reviewed-By: Marco Ippolito -------------------------------------------------------------------------------- ⚠ Commits were pushed since the last review: ⚠ - Update test/parallel/test-http-head-response-has-no-body-end-implicit… ℹ This PR was created on Sun, 21 May 2023 23:17:45 GMT ✔ Approvals: 4 ✔ - Colin Ihrig (@cjihrig) (TSC): https://github.com/nodejs/node/pull/48108#pullrequestreview-1435613010 ✔ - Robert Nagy (@ronag) (TSC): https://github.com/nodejs/node/pull/48108#pullrequestreview-1435740161 ✔ - Paolo Insogna (@ShogunPanda): https://github.com/nodejs/node/pull/48108#pullrequestreview-1435797038 ✔ - Marco Ippolito (@marco-ippolito): https://github.com/nodejs/node/pull/48108#pullrequestreview-1436063447 ✔ Last GitHub CI successful ℹ Last Full PR CI on 2023-05-24T13:41:56Z: https://ci.nodejs.org/job/node-test-pull-request/51947/ - Querying data for job/node-test-pull-request/51947/ ✔ Last Jenkins CI successful -------------------------------------------------------------------------------- ✔ Aborted `git node land` session in /home/runner/work/node/node/.ncuhttps://github.com/nodejs/node/actions/runs/5089120647 |
ronag left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM but I would prefer that if kRejectNonStandardBodyWrites is true we throw before sending headers as that can give a falls sense of success. While if kRejectNonStandardBodyWrites false we have the previous behaviour where we ignore the body but send the headers.
mcollina commented May 26, 2023
I do not have time for further changes to this PR and we should fix the breaking change. Do you prefer a revert of the original PR? |
mcollina commented May 26, 2023
(@ronag you did not approve this PR) |
ronag commented May 26, 2023
@MCOLLINE approved |
nodejs-github-bot commented May 26, 2023
Landed in 38b82b0 |
If we respond to a HEAD request with a body, we ignore all writes. However, we must still include all implicit headers. Fixes a regressions introduced in #47732. Signed-off-by: Matteo Collina <[email protected]> PR-URL: #48108 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Robert Nagy <[email protected]> Reviewed-By: Paolo Insogna <[email protected]> Reviewed-By: Marco Ippolito <[email protected]>
If we respond to a HEAD request with a body, we ignore all writes. However, we must still include all implicit headers. Fixes a regressions introduced in #47732. Signed-off-by: Matteo Collina <[email protected]> PR-URL: #48108 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Robert Nagy <[email protected]> Reviewed-By: Paolo Insogna <[email protected]> Reviewed-By: Marco Ippolito <[email protected]>
If we respond to a HEAD request with a body, we ignore all writes. However, we must still include all implicit headers. Fixes a regressions introduced in nodejs#47732. Signed-off-by: Matteo Collina <[email protected]> PR-URL: nodejs#48108 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Robert Nagy <[email protected]> Reviewed-By: Paolo Insogna <[email protected]> Reviewed-By: Marco Ippolito <[email protected]>
If we respond to a HEAD request with a body, we ignore all writes. However, we must still include all implicit headers. Fixes a regressions introduced in nodejs#47732. Signed-off-by: Matteo Collina <[email protected]> PR-URL: nodejs#48108 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Robert Nagy <[email protected]> Reviewed-By: Paolo Insogna <[email protected]> Reviewed-By: Marco Ippolito <[email protected]>
If we respond to a HEAD request with a body, we ignore all writes. However, we must still include all implicit headers. Fixes a regressions introduced in nodejs#47732. Signed-off-by: Matteo Collina <[email protected]> PR-URL: nodejs#48108 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Robert Nagy <[email protected]> Reviewed-By: Paolo Insogna <[email protected]> Reviewed-By: Marco Ippolito <[email protected]>
If we respond to a HEAD request with a body, we ignore all writes. However, we must still include all implicit headers.
Fixes a regressions introduced in
#47732.