diff options
author | Mark S. Everitt <mark.s.everitt@gmail.com> | 2019-02-06 22:24:50 +0000 |
---|---|---|
committer | Anna Henningsen <anna@addaleax.net> | 2019-02-09 16:34:25 +0100 |
commit | 1aa11e14440dc531a7208128b6416814f7b0964b (patch) | |
tree | 06ac2f7f58ee3996762bf8f4aca77343e2ecd43a /lib | |
parent | f93df511558609fad38fe0ae34635c7c914ad2f8 (diff) | |
download | android-node-v8-1aa11e14440dc531a7208128b6416814f7b0964b.tar.gz android-node-v8-1aa11e14440dc531a7208128b6416814f7b0964b.tar.bz2 android-node-v8-1aa11e14440dc531a7208128b6416814f7b0964b.zip |
http2: makes response.writeHead return the response
Fixes: https://github.com/nodejs/node/issues/25935
PR-URL: https://github.com/nodejs/node/pull/25974
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/internal/http2/compat.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/internal/http2/compat.js b/lib/internal/http2/compat.js index ae5958912e..8043bd492a 100644 --- a/lib/internal/http2/compat.js +++ b/lib/internal/http2/compat.js @@ -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'). if (this.stream.destroyed) - return false; + return this; if (typeof statusMessage === 'string') statusMessageWarn(); @@ -596,6 +594,8 @@ class Http2ServerResponse extends Stream { state.statusCode = statusCode; this[kBeginSend](); + + return this; } write(chunk, encoding, cb) { |