From 0a07c7b75d5d759e11af4a01d0e4a749c69b0fbb Mon Sep 17 00:00:00 2001 From: Et7f3 Date: Tue, 4 Aug 2020 02:47:21 +0200 Subject: [PATCH] Apply change from v11.10.0, v10.17.0 Return this from writeHead() to allow chaining with end(). Source: https://nodejs.org/api/http.html#http_response_writehead_statuscode_statusmessage_headers --- lib/spdy/response.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/spdy/response.js b/lib/spdy/response.js index e607918..64474f9 100644 --- a/lib/spdy/response.js +++ b/lib/spdy/response.js @@ -57,6 +57,8 @@ exports.writeHead = function writeHead (statusCode, reason, obj) { this._headerSent = true if (this.socket._handle) { this.socket._handle._spdyState.stream.respond(this.statusCode, headers) } + + return this; } exports.end = function end (data, encoding, callback) {