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 from
Closed

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

wants to merge 7 commits into from

Conversation

@qubyte
Copy link
Contributor

@qubyte 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.

doc/api/http.md Outdated Show resolved Hide resolved
doc/api/http2.md Outdated Show resolved Hide resolved
addaleax and others added 2 commits Feb 7, 2019
Addresses PR feedback.

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

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

@vsemozhetbyt vsemozhetbyt left a comment

Thank you. Some doc nits.

doc/api/http2.md Outdated Show resolved Hide resolved
doc/api/http.md Outdated Show resolved Hide resolved
doc/api/http2.md Outdated Show resolved Hide resolved
vsemozhetbyt and others added 2 commits Feb 7, 2019
Addresses PR feedback.

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

Co-Authored-By: qubyte <mark.s.everitt@gmail.com>
@lpinca
lpinca approved these changes Feb 7, 2019
Addresses PR feedback.

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

@addaleax 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
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
Fixes: #25935

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

@qubyte qubyte commented Feb 9, 2019

Thanks for accepting! 😁

@qubyte qubyte deleted the qubyte:http-response-writehead-return-this branch Feb 27, 2019
BethGriggs added a commit that referenced this pull request Oct 7, 2019
Fixes: #25935

PR-URL: #25974
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
BethGriggs added a commit that referenced this pull request Oct 7, 2019
Fixes: #25935

PR-URL: #25974
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
@BethGriggs BethGriggs mentioned this pull request Oct 7, 2019
BethGriggs added a commit that referenced this pull request Oct 22, 2019
Notable changes:

* crypto:
  * add support for chacha20-poly1305 for AEAD (chux0519)
    #24081
  * increase maxmem range from 32 to 53 bits (Tobias Nießen)
    #28799
* deps:
  * update npm to 6.11.3 (claudiahdz)
    #29430
  * upgrade openssl sources to 1.1.1d (Sam Roberts)
    #29921
* dns:
  * remove dns.promises experimental warning (cjihrig)
    #26592
* fs:
  * remove experimental warning for fs.promises (Anna Henningsen)
    #26581
* http:
  * makes response.writeHead return the response (Mark S. Everitt)
    #25974
* http2:
  * makes response.writeHead return the response (Mark S. Everitt)
    #25974
* n-api:
  * make func argument of napi\_create\_threadsafe\_function optional
    (legendecas)
    #27791
  * mark version 5 N-APIs as stable (Gabriel Schulhof)
    #29401
  * implement date object (Jarrod Connolly)
    #25917
* process:
  * add --unhandled-rejections flag (Ruben Bridgewater)
    #26599
* stream:
  * implement Readable.from async iterator utility (Guy Bedford)
    #27660
  * make Symbol.asyncIterator support stable (Matteo Collina)
    #26989

PR-URL: #29875
BethGriggs added a commit that referenced this pull request Oct 22, 2019
Notable changes:

* crypto:
  * add support for chacha20-poly1305 for AEAD (chux0519)
    #24081
  * increase maxmem range from 32 to 53 bits (Tobias Nießen)
    #28799
* deps:
  * update npm to 6.11.3 (claudiahdz)
    #29430
  * upgrade openssl sources to 1.1.1d (Sam Roberts)
    #29921
* dns:
  * remove dns.promises experimental warning (cjihrig)
    #26592
* fs:
  * remove experimental warning for fs.promises (Anna Henningsen)
    #26581
* http:
  * makes response.writeHead return the response (Mark S. Everitt)
    #25974
* http2:
  * makes response.writeHead return the response (Mark S. Everitt)
    #25974
* n-api:
  * make func argument of napi\_create\_threadsafe\_function optional
    (legendecas)
    #27791
  * mark version 5 N-APIs as stable (Gabriel Schulhof)
    #29401
  * implement date object (Jarrod Connolly)
    #25917
* process:
  * add --unhandled-rejections flag (Ruben Bridgewater)
    #26599
* stream:
  * implement Readable.from async iterator utility (Guy Bedford)
    #27660
  * make Symbol.asyncIterator support stable (Matteo Collina)
    #26989

PR-URL: #29875
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

6 participants