Skip to content

Commit

Permalink
response: set .finished to true on .end()
Browse files Browse the repository at this point in the history
Fix: #276
  • Loading branch information
indutny committed Sep 19, 2016
1 parent 7524b4e commit a583cf6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/spdy/response.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ exports.end = function end(data, encoding, callback) {
if (!this.socket._handle)
return;

// Compatibility with Node.js core
this.finished = true;

var self = this;
var handle = this.socket._handle;
handle._spdyState.ending = true;
Expand Down
1 change: 1 addition & 0 deletions test/server-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ describe('SPDY Server', function() {
ok: 'yes'
});
res.end('response');
assert(res.finished, 'res.finished should be set');
});
req.resume();
});
Expand Down

0 comments on commit a583cf6

Please sign in to comment.