-
Notifications
You must be signed in to change notification settings - Fork 30.2k
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
lib: refactor ServerResponse.prototype.writeHead #32399
Conversation
137b347
to
70ca662
Compare
70ca662
to
10962bc
Compare
@@ -150,7 +150,7 @@ const s = http.createServer(common.mustCall((req, res) => { | |||
case 'writeHead': | |||
res.statusCode = 404; | |||
res.setHeader('x-foo', 'keyboard cat'); | |||
res.writeHead(200, { 'x-foo': 'bar', 'x-bar': 'baz' }); | |||
res.writeHead(200, undefined, { 'x-foo': 'bar', 'x-bar': 'baz' }); |
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.
Should we also keep the test case for writeHead(status[, headers])
?
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.
Yes, I'm looking for a suitable test file to add this new case
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.
@himself65 ping, did you get any further with this?
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.
oh no, I have forgot about this...
8ae28ff
to
2935f72
Compare
@himself65 This needs a rebase. |
This issue/PR was marked as stalled, it will be automatically closed in 30 days. If it should remain open, please leave a comment explaining why it should remain open. |
Closing this because it has stalled. Feel free to reopen if this PR is still relevant, or to ping the collaborator who labelled it stalled if you have any questions. |
fix #32395
make
HTTP
andHTTP2
the behavior the same.example, allow
response.writeHead(200, undefined, { ...headers })
when the second parameter is undefined passingnode/lib/internal/http2/compat.js
Lines 608 to 620 in d129e0c
btw, I renamed the name of parameters for better coding experience
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes