http2: compat req.complete
PR-URL: https://github.com/nodejs/node/pull/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>
This commit is contained in:
parent
7a1f33c394
commit
b30dca8d9e
@ -302,7 +302,8 @@ class Http2ServerRequest extends Readable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
get complete() {
|
get complete() {
|
||||||
return this._readableState.ended ||
|
return this[kAborted] ||
|
||||||
|
this._readableState.ended ||
|
||||||
this[kState].closed ||
|
this[kState].closed ||
|
||||||
this[kStream].destroyed;
|
this[kStream].destroyed;
|
||||||
}
|
}
|
||||||
|
@ -10,8 +10,10 @@ const assert = require('assert');
|
|||||||
const server = h2.createServer(common.mustCall(function(req, res) {
|
const server = h2.createServer(common.mustCall(function(req, res) {
|
||||||
req.on('aborted', common.mustCall(function() {
|
req.on('aborted', common.mustCall(function() {
|
||||||
assert.strictEqual(this.aborted, true);
|
assert.strictEqual(this.aborted, true);
|
||||||
|
assert.strictEqual(this.complete, true);
|
||||||
}));
|
}));
|
||||||
assert.strictEqual(req.aborted, false);
|
assert.strictEqual(req.aborted, false);
|
||||||
|
assert.strictEqual(req.complete, false);
|
||||||
res.write('hello');
|
res.write('hello');
|
||||||
server.close();
|
server.close();
|
||||||
}));
|
}));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user