Repository navigation
http2: add missing setHeaders - #67597
Merged
nodejs-github-bot merged 2 commits intoNov 21, 2026
Merged
Conversation
Make it possible to invoke response.setHeaders() on the Http2ServerResponse object, matching the http.OutgoingMessage API. Fixes: nodejs#51573 Refs: nodejs#51576 Signed-off-by: jakecastelli <38635403+jakecastelli@users.noreply.github.com> Signed-off-by: Mikhail Leliakin <leliakin@canva.com> Co-authored-by: Mikhail Leliakin <leliakin@canva.com> Assisted-by: Cursor
Collaborator
|
Review requested:
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #67597 +/- ##
==========================================
- Coverage 90.73% 90.71% -0.02%
==========================================
Files 801 801
Lines 280787 280929 +142
Branches 54221 54258 +37
==========================================
+ Hits 254765 254843 +78
- Misses 16203 16255 +52
- Partials 9819 9831 +12
🚀 New features to boost your workflow:
|
Contributor
|
The implementation looks good to me. I think it needs more test coverage. It only covers the happy path, so test cases like the following could be added:
And most of the cases in |
Port the cases of test-http-response-setheaders.js: Headers instances, multiple set-cookie values, replacing headers set before, precedence of writeHead(), and the `ERR_HTTP2_HEADERS_SENT` and `ERR_INVALID_ARG_TYPE` errors. Signed-off-by: jakecastelli <38635403+jakecastelli@users.noreply.github.com>
jakecastelli
force-pushed
the
http2-add-setHeaders
branch
from
November 20, 2026 01:28
ea890c5 to
0370d7b
Compare
inoway46
approved these changes
Nov 20, 2026
inoway46
left a comment
Contributor
There was a problem hiding this comment.
Thanks for adding the tests! This covers the cases I had in mind. Looks good to me.
Collaborator
Contributor
|
Adding the semver-minor label since this PR introduces a new public API, Http2ServerResponse.setHeaders(). |
Collaborator
|
Landed in 6d426a0 |
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
Reopens / supersedes #51576.
Http2ServerResponse.setHeaders()to matchhttp.OutgoingMessage.setHeaders()http2:commit message, DCO sign-offs for both authorsFixes: #51573
Refs: #51576
Original work by @Imperat.