Skip to content

Commit ad54edb

Browse files
ronaggntem
authored andcommitted
http2: compat req.complete
PR-URL: nodejs#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>
1 parent 1eb5dae commit ad54edb

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

lib/internal/http2/compat.js

+2-1
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

+2
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)