summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Nagy <ronagy@icloud.com>2019-07-10 21:59:36 +0200
committerMichaƫl Zasso <targos@protonmail.com>2019-07-22 21:20:42 +0200
commit49e4d72b5a7fcf643e1476b0f382ed08cacd6c0a (patch)
tree76f6ad9d5374e3f6473bb56cfc9e40237d4276d6
parent74243da70792f49cabd5e2b8bff5b915b4a3e759 (diff)
downloadandroid-node-v8-49e4d72b5a7fcf643e1476b0f382ed08cacd6c0a.tar.gz
android-node-v8-49e4d72b5a7fcf643e1476b0f382ed08cacd6c0a.tar.bz2
android-node-v8-49e4d72b5a7fcf643e1476b0f382ed08cacd6c0a.zip
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>
-rw-r--r--lib/internal/http2/compat.js3
-rw-r--r--test/parallel/test-http2-compat-aborted.js2
2 files changed, 4 insertions, 1 deletions
diff --git a/lib/internal/http2/compat.js b/lib/internal/http2/compat.js
index 5169545871..c707c22be9 100644
--- a/lib/internal/http2/compat.js
+++ b/lib/internal/http2/compat.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;
}
diff --git a/test/parallel/test-http2-compat-aborted.js b/test/parallel/test-http2-compat-aborted.js
index 01caf95f98..0ed0d80043 100644
--- a/test/parallel/test-http2-compat-aborted.js
+++ b/test/parallel/test-http2-compat-aborted.js
@@ -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();
}));