Makes http(2) response.writehead return this by qubyte · Pull Request #25974 · nodejs/node (original) (raw)

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 andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed

qubyte wants to merge7 commits intonodejs:masterfromqubyte:http-response-writehead-return-this

Conversation10 Commits7 Checks0 Files changed

Conversation

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters

[ Show hidden characters]({{ revealButtonHref }})

qubyte

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

qubyte

@@ -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').

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@qubyte

@qubyte

addaleax

@addaleax @qubyte

Addresses PR feedback.

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

@addaleax @qubyte

Addresses PR feedback.

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

vsemozhetbyt

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you. Some doc nits.

@vsemozhetbyt @qubyte

Addresses PR feedback.

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

@vsemozhetbyt @qubyte

Addresses PR feedback.

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

lpinca

@vsemozhetbyt @qubyte

Addresses PR feedback.

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

@lpinca

@addaleax addaleax added the semver-minor

PRs that contain new features and should be released in the next minor version.

label

Feb 9, 2019

@addaleax

addaleax pushed a commit that referenced this pull request

Feb 9, 2019

@qubyte @addaleax

Fixes: #25935

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

addaleax pushed a commit that referenced this pull request

Feb 9, 2019

@qubyte @addaleax

Fixes: #25935

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

@qubyte

targos pushed a commit that referenced this pull request

Feb 10, 2019

@qubyte @targos

Fixes: #25935

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

targos pushed a commit that referenced this pull request

Feb 10, 2019

@qubyte @targos

Fixes: #25935

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

This was referenced

Feb 15, 2019

@qubyte qubyte deleted the http-response-writehead-return-this branch

February 27, 2019 22:54

BethGriggs pushed a commit that referenced this pull request

Oct 7, 2019

@qubyte @BethGriggs

Fixes: #25935

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

BethGriggs pushed a commit that referenced this pull request

Oct 7, 2019

@qubyte @BethGriggs

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 22, 2019

@BethGriggs

Notable changes:

PR-URL: #29875

BethGriggs added a commit that referenced this pull request

Oct 22, 2019

@BethGriggs

Notable changes:

PR-URL: #29875

Labels

http

Issues or PRs related to the http subsystem.

http2

Issues or PRs related to the http2 subsystem.

semver-minor

PRs that contain new features and should be released in the next minor version.