Skip to content
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

Makes http(2) response.writehead return this #25974

Closed
wants to merge 7 commits into
base: master
from

Conversation

Projects
None yet
5 participants
@qubyte
Copy link
Contributor

qubyte commented Feb 7, 2019

Addresses #25935.

I chose in the end to go with the lightest touch and only update writeHead (this is the most useful to change in my experience). I'm happy to extend this to res.setHeader too, but it may suggest updating other similar methods (flushHeaders, removeHeader, etc.)

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines
@@ -568,10 +568,8 @@ class Http2ServerResponse extends Stream {
if (this[kStream].headersSent)
throw new ERR_HTTP2_HEADERS_SENT();

// If the stream is destroyed, we return false,
// like require('http').

This comment has been minimized.

@qubyte

qubyte Feb 7, 2019

Author Contributor

I couldn't find the code which this refers to. The HTTP version of writeHead appears to have no explicit returns.

qubyte added some commits Feb 6, 2019

Show resolved Hide resolved doc/api/http.md Outdated
Show resolved Hide resolved doc/api/http2.md Outdated

addaleax and others added some commits Feb 7, 2019

http: update to documentation
Addresses PR feedback.

Co-Authored-By: qubyte <mark.s.everitt@gmail.com>
http2: update to documentation
Addresses PR feedback.

Co-Authored-By: qubyte <mark.s.everitt@gmail.com>
@vsemozhetbyt
Copy link
Member

vsemozhetbyt left a comment

Thank you. Some doc nits.

Show resolved Hide resolved doc/api/http2.md Outdated
Show resolved Hide resolved doc/api/http.md Outdated
Show resolved Hide resolved doc/api/http2.md Outdated

vsemozhetbyt and others added some commits Feb 7, 2019

http2: update to documentation
Addresses PR feedback.

Co-Authored-By: qubyte <mark.s.everitt@gmail.com>
http: update to documentation
Addresses PR feedback.

Co-Authored-By: qubyte <mark.s.everitt@gmail.com>
@lpinca

lpinca approved these changes Feb 7, 2019

http2: update to documentation
Addresses PR feedback.

Co-Authored-By: qubyte <mark.s.everitt@gmail.com>
@lpinca

This comment has been minimized.

@addaleax

This comment has been minimized.

Copy link
Member

addaleax commented Feb 9, 2019

Landed in f93df51, 1aa11e1 – thanks for the PR! 🎉

@addaleax addaleax closed this Feb 9, 2019

addaleax added a commit that referenced this pull request Feb 9, 2019

http: makes response.writeHead return the response
Fixes: #25935

PR-URL: #25974
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>

addaleax added a commit that referenced this pull request Feb 9, 2019

http2: makes response.writeHead return the response
Fixes: #25935

PR-URL: #25974
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
@qubyte

This comment has been minimized.

Copy link
Contributor Author

qubyte commented Feb 9, 2019

Thanks for accepting! 😁

targos added a commit that referenced this pull request Feb 10, 2019

http: makes response.writeHead return the response
Fixes: #25935

PR-URL: #25974
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>

targos added a commit that referenced this pull request Feb 10, 2019

http2: makes response.writeHead return the response
Fixes: #25935

PR-URL: #25974
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>

@targos targos referenced this pull request Feb 14, 2019

Merged

v11.10.0 proposal #26098

@qubyte qubyte deleted the qubyte:http-response-writehead-return-this branch Feb 27, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.