GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — http2: add missing setHeaders by jakecastelli · Pull Request #67597 · nodejs/node

Conversation

@jakecastelli

@jakecastelli jakecastelli commented Nov 19, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Summary

Reopens / supersedes #51576.

  • Adds Http2ServerResponse.setHeaders() to match http.OutgoingMessage.setHeaders()
  • Includes set-cookie handling consistent with the HTTP implementation
  • Squashed to a single commit with a proper http2: commit message, DCO sign-offs for both authors

Fixes: #51573
Refs: #51576

Original work by @Imperat.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

danfuzz and Imperat reacted with heart emoji
All reactions
  • ❤️ 2 reactions
@jakecastelli @Imperat
http2: add missing setHeaders
8c534ef
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 <[email protected]>
Signed-off-by: Mikhail Leliakin <[email protected]>
Co-authored-by: Mikhail Leliakin <[email protected]>
Assisted-by: Cursor
@nodejs-github-bot

nodejs-github-bot commented Nov 19, 2026

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/http
  • @nodejs/http2
  • @nodejs/net
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nodejs-github-bot nodejs-github-bot added the http2 Issues and PRs related to the http2 subsystem. label Nov 19, 2026
@jakecastelli jakecastelli mentioned this pull request Nov 19, 2026
Missing Http2ServerResponse.setHeaders() fixed #51576
Closed
@nodejs-github-bot nodejs-github-bot added the needs-ci PRs that need a full CI run. label Nov 19, 2026
@jakecastelli
jakecastelli requested review from efekrskl and pimterry November 19, 2026 02:32
@codecov

codecov Bot commented Nov 19, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.71%. Comparing base (b7df44b) to head (0370d7b).
⚠️ Report is 62 commits behind head on main.

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     
Files with missing lines Coverage Δ
lib/internal/http2/compat.js 97.40% <100.00%> (+0.10%) ⬆️

... and 65 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@inoway46

inoway46 commented Nov 19, 2026

Copy link
Copy Markdown
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:

  • Headers instance
  • multiple set-cookie values
  • error cases (ERR_HTTP2_HEADERS_SENT, ERR_INVALID_ARG_TYPE)

And most of the cases in test/parallel/test-http-response-setheaders.js could be ported over.

jakecastelli reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jakecastelli jakecastelli added the commit-queue-squash PRs the Commit Queue should land as one squashed commit. label Nov 20, 2026
@jakecastelli
test: cover more cases of http2 response.setHeaders()
0370d7b
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 <[email protected]>
@jakecastelli
jakecastelli force-pushed the http2-add-setHeaders branch from ea890c5 to 0370d7b Compare November 20, 2026 01:28
inoway46
inoway46 approved these changes Nov 20, 2026
View reviewed changes

@inoway46 inoway46 left a comment

Copy link
Copy Markdown
Contributor

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.

Thanks for adding the tests! This covers the cases I had in mind. Looks good to me.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

jakecastelli reacted with heart emoji
All reactions
  • ❤️ 1 reaction
jazelly
jazelly approved these changes Nov 21, 2026
View reviewed changes

@jazelly jazelly left a comment

Copy link
Copy Markdown
Member

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@jazelly jazelly added the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Nov 21, 2026
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Nov 21, 2026
@nodejs-github-bot

nodejs-github-bot commented Nov 21, 2026

Copy link
Copy Markdown
Collaborator

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

mcollina
mcollina approved these changes Nov 21, 2026
View reviewed changes

@mcollina mcollina left a comment

Copy link
Copy Markdown
Member

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@inoway46 inoway46 added the semver-minor PRs that contain new features and should be released in the next minor version. label Nov 21, 2026
@inoway46

inoway46 commented Nov 21, 2026

Copy link
Copy Markdown
Contributor

Adding the semver-minor label since this PR introduces a new public API, Http2ServerResponse.setHeaders().

jakecastelli reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@inoway46 inoway46 added author ready PRs with CI started, the required approvals, and no outstanding review comments. commit-queue PRs queued for automated landing through the Commit Queue. labels Nov 21, 2026
@nodejs-github-bot
nodejs-github-bot merged commit 6d426a0 into nodejs:main Nov 21, 2026
81 of 82 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@nodejs-github-bot

nodejs-github-bot commented Nov 21, 2026

Copy link
Copy Markdown
Collaborator

Landed in 6d426a0

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nodejs-github-bot nodejs-github-bot removed the commit-queue PRs queued for automated landing through the Commit Queue. label Nov 21, 2026
aduh95 pushed a commit that referenced this pull request Nov 23, 2026
@jakecastelli @Imperat @aduh95
http2: add missing setHeaders
265bbc1
Make it possible to invoke response.setHeaders() on the
Http2ServerResponse object, matching the http.OutgoingMessage API.

Fixes: #51573
Refs: #51576
Signed-off-by: jakecastelli <[email protected]>
Signed-off-by: Mikhail Leliakin <[email protected]>
Co-authored-by: Mikhail Leliakin <[email protected]>
Assisted-by: Cursor
PR-URL: #67597
Reviewed-By: Jason Zhang <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
@github-actions github-actions Bot mentioned this pull request Nov 24, 2026
2026-11-25, Version 27.0.0-alpha.0.2.0 (Alpha) #67757
Merged
nodejs-github-bot added a commit that referenced this pull request Nov 24, 2026
@nodejs-github-bot
2026-11-25, Version 27.0.0-alpha.0.2.0 (Alpha)
0296c04
Notable changes:

doc:
  * swap `util.TextDecoder` and `util.TextEncoder` with globals (LiviaMedeiros) #67461
  * use global `TextDecoder` and `TextEncoder` instead of `util` (LiviaMedeiros) #67461
  * deprecate `util.TextDecoder` and `util.TextEncoder` (LiviaMedeiros) #67461
http2:
  * (SEMVER-MINOR) add missing setHeaders (jakecastelli) #67597
  * (SEMVER-MINOR) add callback to informational header methods (Yuya Inoue) #67470
lib:
  * (SEMVER-MINOR) graduate the --process-timeout option (James M Snell) #67506
module:
  * remove async module customization hooks (Geoffrey Booth) #67090
os:
  * (SEMVER-MINOR) expose `guessFileDescriptorType` (Vlad Frangu) #58060
sqlite:
  * mark as stable (Christian Aurich Zanettini Martins) #67654
src:
  * (SEMVER-MINOR) restore tty state on exit only if changed (Matteo Collina) #66753
test:
  * update Intl tests for CLDR 49 (Renegade334) #66992
  * remove unnecessary imports for `TextDecoder` and `TextEncoder` (LiviaMedeiros) #67461
tls:
  * (SEMVER-MINOR) docs-deprecate TLS renegotiation, add allowRenegotiation opt-in (Tim Perry) #67532

PR-URL: #67757
aduh95 pushed a commit that referenced this pull request Nov 24, 2026
@nodejs-github-bot @aduh95
2026-11-25, Version 27.0.0-alpha.0.2.0 (Alpha)
9d44b49
Notable changes:

doc:
  * deprecate `util.TextDecoder` and `util.TextEncoder` (LiviaMedeiros) #67461
http2:
  * (SEMVER-MINOR) add missing setHeaders (jakecastelli) #67597
  * (SEMVER-MINOR) add callback to informational header methods (Yuya Inoue) #67470
lib:
  * (SEMVER-MINOR) graduate the `--process-timeout` option (James M Snell) #67506
module:
  * remove async module customization hooks (Geoffrey Booth) #67090
os:
  * (SEMVER-MINOR) expose `guessFileDescriptorType` (Vlad Frangu) #58060
sqlite:
  * mark as stable (Christian Aurich Zanettini Martins) #67654
src:
  * (SEMVER-MINOR) restore tty state on exit only if changed (Matteo Collina) #66753
tls:
  * (SEMVER-MINOR) docs-deprecate TLS renegotiation, add allowRenegotiation opt-in (Tim Perry) #67532

PR-URL: #67757
aduh95 added a commit that referenced this pull request Nov 25, 2026
@aduh95
2026-11-26, Version 27.0.0-alpha.0.2.0 (Alpha)
67d9357
Notable changes:

doc:
  * deprecate `util.TextDecoder` and `util.TextEncoder` (LiviaMedeiros) #67461
http2:
  * (SEMVER-MINOR) add writeProcessing to compat response (Yuya Inoue) #67728
  * (SEMVER-MINOR) add missing setHeaders (jakecastelli) #67597
  * (SEMVER-MINOR) add callback to informational header methods (Yuya Inoue) #67470
lib:
  * (SEMVER-MINOR) graduate the --process-timeout option (James M Snell) #67506
os:
  * (SEMVER-MINOR) expose `guessFileDescriptorType` (Vlad Frangu) #58060
sqlite:
  * (SEMVER-MINOR) throw ERR_NO_SQLITE without SQLite support (Christian Aurich Zanettini Martins) #67727
  * (SEMVER-MINOR) add statement.columnCount getter (Guilherme Araújo) #67658
  * mark as stable (Christian Aurich Zanettini Martins) #67654
src:
  * (SEMVER-MINOR) expand --process-timeout output to include workers (James M Snell) #67712
  * (SEMVER-MINOR) restore tty state on exit only if changed (Matteo Collina) #66753
tls:
  * (SEMVER-MINOR) docs-deprecate TLS renegotiation, add allowRenegotiation opt-in (Tim Perry) #67532

PR-URL: #67757
aduh95 added a commit that referenced this pull request Nov 26, 2026
@aduh95
2026-11-26, Version 27.0.0-alpha.0.2.0 (Alpha)
4325ce0
Notable changes:

doc:
  * deprecate `util.TextDecoder` and `util.TextEncoder` (LiviaMedeiros) #67461
http2:
  * (SEMVER-MINOR) add writeProcessing to compat response (Yuya Inoue) #67728
  * (SEMVER-MINOR) add missing setHeaders (jakecastelli) #67597
  * (SEMVER-MINOR) add callback to informational header methods (Yuya Inoue) #67470
lib:
  * (SEMVER-MINOR) graduate the --process-timeout option (James M Snell) #67506
os:
  * (SEMVER-MINOR) expose `guessFileDescriptorType` (Vlad Frangu) #58060
sqlite:
  * (SEMVER-MINOR) throw ERR_NO_SQLITE without SQLite support (Christian Aurich Zanettini Martins) #67727
  * (SEMVER-MINOR) add statement.columnCount getter (Guilherme Araújo) #67658
  * mark as stable (Christian Aurich Zanettini Martins) #67654
src:
  * (SEMVER-MINOR) expand --process-timeout output to include workers (James M Snell) #67712
  * (SEMVER-MINOR) restore tty state on exit only if changed (Matteo Collina) #66753
tls:
  * (SEMVER-MINOR) docs-deprecate TLS renegotiation, add allowRenegotiation opt-in (Tim Perry) #67532

PR-URL: #67757
gabylb pushed a commit to gabylb/node that referenced this pull request Nov 27, 2026
@jakecastelli @Imperat @gabylb
http2: add missing setHeaders
c20dd98
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 <[email protected]>
Signed-off-by: Mikhail Leliakin <[email protected]>
Co-authored-by: Mikhail Leliakin <[email protected]>
Assisted-by: Cursor
PR-URL: nodejs#67597
Reviewed-By: Jason Zhang <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
gabylb pushed a commit to gabylb/node that referenced this pull request Nov 27, 2026
@aduh95 @gabylb
2026-11-26, Version 27.0.0-alpha.0.2.0 (Alpha)
369cdc7
Notable changes:

doc:
  * deprecate `util.TextDecoder` and `util.TextEncoder` (LiviaMedeiros) nodejs#67461
http2:
  * (SEMVER-MINOR) add writeProcessing to compat response (Yuya Inoue) nodejs#67728
  * (SEMVER-MINOR) add missing setHeaders (jakecastelli) nodejs#67597
  * (SEMVER-MINOR) add callback to informational header methods (Yuya Inoue) nodejs#67470
lib:
  * (SEMVER-MINOR) graduate the --process-timeout option (James M Snell) nodejs#67506
os:
  * (SEMVER-MINOR) expose `guessFileDescriptorType` (Vlad Frangu) nodejs#58060
sqlite:
  * (SEMVER-MINOR) throw ERR_NO_SQLITE without SQLite support (Christian Aurich Zanettini Martins) nodejs#67727
  * (SEMVER-MINOR) add statement.columnCount getter (Guilherme Araújo) nodejs#67658
  * mark as stable (Christian Aurich Zanettini Martins) nodejs#67654
src:
  * (SEMVER-MINOR) expand --process-timeout output to include workers (James M Snell) nodejs#67712
  * (SEMVER-MINOR) restore tty state on exit only if changed (Matteo Collina) nodejs#66753
tls:
  * (SEMVER-MINOR) docs-deprecate TLS renegotiation, add allowRenegotiation opt-in (Tim Perry) nodejs#67532

PR-URL: nodejs#67757
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@mcollina mcollina mcollina approved these changes
@jazelly jazelly jazelly approved these changes
@pimterry pimterry Awaiting requested review from pimterry
@efekrskl efekrskl Awaiting requested review from efekrskl
+1 more reviewer
@inoway46 inoway46 inoway46 approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

author ready PRs with CI started, the required approvals, and no outstanding review comments. commit-queue-squash PRs the Commit Queue should land as one squashed commit. http2 Issues and PRs related to the http2 subsystem. needs-ci PRs that need a full CI run. semver-minor PRs that contain new features and should be released in the next minor version.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Missing Http2ServerResponse.setHeaders()

Uh oh!

There was an error while loading. Please reload this page.

5 participants

@jakecastelli @nodejs-github-bot @inoway46 @mcollina @jazelly
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.