Skip to content
Permalink
Browse files

http2: compat req.complete

PR-URL: #28627
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
  • Loading branch information...
ronag authored and targos committed Jul 10, 2019
1 parent 74243da commit 49e4d72b5a7fcf643e1476b0f382ed08cacd6c0a
Showing with 4 additions and 1 deletion.
  1. +2 −1 lib/internal/http2/compat.js
  2. +2 −0 test/parallel/test-http2-compat-aborted.js
@@ -302,7 +302,8 @@ class Http2ServerRequest extends Readable {
}

get complete() {
return this._readableState.ended ||
return this[kAborted] ||
this._readableState.ended ||
this[kState].closed ||
this[kStream].destroyed;
}
@@ -10,8 +10,10 @@ const assert = require('assert');
const server = h2.createServer(common.mustCall(function(req, res) {
req.on('aborted', common.mustCall(function() {
assert.strictEqual(this.aborted, true);
assert.strictEqual(this.complete, true);
}));
assert.strictEqual(req.aborted, false);
assert.strictEqual(req.complete, false);
res.write('hello');
server.close();
}));

0 comments on commit 49e4d72

Please sign in to comment.
You can’t perform that action at this time.