Missing `Http2ServerResponse.setHeaders()`
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 122k
- Forks
- 37.3k
- Avg merge
- 4d 2h
- Merged PRs (30d)
- 283
Description
What is the problem this feature will solve?
Make it possible to use response.setHeaders() on both old HTTP response objects and ones coming from node:http2.
BTW I wasn't sure if this should be a "feature request" or a "bug."
What is the feature you are proposing to solve the problem?
Add the method http2.Http2ServerResponse.setHeaders() to have the same API as http.OutgoingMessage.setHeaders().
See https://nodejs.org/api/http.html#outgoingmessagesetheadersheaders.
What alternatives have you considered?
- Avoiding using
setHeaders()at all. - Monkey-patching
Http2ServerResponse. - Just writing two versions of my own set-headers code, on the assumption that, when available,
setHeaders()is the most efficient option.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the node:http2 Http2ServerResponse entry point and compare its API with http.OutgoingMessage.setHeaders(), using the linked HTTP documentation as the behavioral reference. Done means Http2ServerResponse exposes setHeaders() with the same API and behavior as the existing HTTP response objects, with appropriate coverage for the new method.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js
- Domain
- api, backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100