Skip to content

Commit 49e4d72

Browse files
ronagtargos
authored andcommitted
http2: compat req.complete
PR-URL: #28627 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Rich Trott <[email protected]>
1 parent 74243da commit 49e4d72

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

lib/internal/http2/compat.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,8 @@ class Http2ServerRequest extends Readable {
302302
}
303303

304304
get complete() {
305-
return this._readableState.ended ||
305+
return this[kAborted] ||
306+
this._readableState.ended ||
306307
this[kState].closed ||
307308
this[kStream].destroyed;
308309
}

test/parallel/test-http2-compat-aborted.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@ const assert = require('assert');
1010
const server = h2.createServer(common.mustCall(function(req, res) {
1111
req.on('aborted', common.mustCall(function() {
1212
assert.strictEqual(this.aborted, true);
13+
assert.strictEqual(this.complete, true);
1314
}));
1415
assert.strictEqual(req.aborted, false);
16+
assert.strictEqual(req.complete, false);
1517
res.write('hello');
1618
server.close();
1719
}));

0 commit comments

Comments
 (0)