From 91c57b76613fbc9a4256e9984cd5726d17b744e4 Mon Sep 17 00:00:00 2001 From: Michael VERGOZ Date: Thu, 2 May 2019 16:42:50 +0200 Subject: [PATCH] Proposal for issue #327 --- lib/spdy/response.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/spdy/response.js b/lib/spdy/response.js index e607918..1aa9059 100644 --- a/lib/spdy/response.js +++ b/lib/spdy/response.js @@ -4,6 +4,14 @@ exports.writeHead = function writeHead (statusCode, reason, obj) { var headers + // Issue #327 + // fix finish response event + // by listening the finish SPDY stream event + var self = this + this.spdyStream.once('finish', function() { + self.emit('finish'); + }) + if (typeof reason === 'string') { // writeHead(statusCode, reasonPhrase[, headers]) this.statusMessage = reason