diff options
Diffstat (limited to 'lib/internal/http2/compat.js')
-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) { |