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