Repository navigation
doc: clarify sendingHeaders listener timing - #67969
Open
lightning4747 wants to merge 1 commit into
Open
lightning4747 wants to merge 1 commit into
lightning4747 wants to merge 1 commit into
Conversation
Collaborator
|
Review requested:
|
Contributor
|
Welcome to Node.js, and thank you for your first contribution! Before review, please take a moment to read:
Please make sure every commit is signed off. For a first pull request, GitHub Actions require collaborator approval and Jenkins CI must be started by a collaborator or triager, so an initial wait is normal. |
Member
|
See Commit message guidelines according to the Pull requests documentation. Your commit must contain the |
Assisted-by: Codex Signed-off-by: lightning4747 <vignesh112847@gmail.com>
lightning4747
force-pushed
the
doc/clarify-sending-headers-async
branch
from
December 2, 2026 16:27
5e4fccc to
632c431
Compare
Author
|
@MikeMcC399 Thanks for pointing it out. I added my Signed-off-by trailer and pushed the amended commit. |
bjohansebas
approved these changes
Dec 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Clarify sendingHeaders listener timing in the HTTP/1 and HTTP/2 compatibility docs. Node.js calls listeners synchronously and sends the headers without waiting for returned promises. An async listener can change the response headers and status before its first await.
Verification
Tested direct registration of an async listener for both protocols on Linux with Node.js v28.0.0-nightly20261201d4318d93f3. Both clients received the header and status 201 set before await. After await, setHeader() threw ERR_HTTP_HEADERS_SENT for HTTP/1 and ERR_HTTP2_HEADERS_SENT for HTTP/2. An attempted status change to 503 left the response status at 201.
Both existing test files passed:
Fixes: #67963
Refs: #63996
assisted-by : codex - gpt 6.2 sol