Skip to content
Permalink
Browse files

http2: do not falsely emit 'aborted' on push

A push stream should have its writable side closed upon receipt,
to avoid emitting the 'aborted' event when the readable side
is closed.

Backport-PR-URL: #22850
PR-URL: #22878
Fixes: #22851
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
  • Loading branch information...
apapirovski authored and BethGriggs committed Sep 15, 2018
1 parent 49f44f3 commit ca933ce5778364b46d6a8ad6dd4dca456119b948
Showing with 2 additions and 0 deletions.
  1. +1 −0 lib/internal/http2/core.js
  2. +1 −0 test/parallel/test-http2-server-push-stream.js
@@ -220,6 +220,7 @@ function onSessionHeaders(handle, id, cat, flags, headers) {
}
} else {
stream = new ClientHttp2Stream(session, handle, id, opts);
stream.end();
}
if (endOfStream)
stream[kState].endAfterHeaders = true;
@@ -54,6 +54,7 @@ server.listen(0, common.mustCall(() => {
assert.strictEqual(headers['content-type'], 'text/html');
assert.strictEqual(headers['x-push-data'], 'pushed by server');
}));
stream.on('aborted', common.mustNotCall());
}));

let data = '';

0 comments on commit ca933ce

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