mirror of
https://github.com/nodejs/node.git
synced 2026-11-26 21:58:26 -05:00
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. PR-URL: https://github.com/nodejs/node/pull/22878 Fixes: https://github.com/nodejs/node/issues/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>
This commit is contained in:
1 parent
b6cd18517c
commit
badc38f305
2 files changed
+2
No files matched your search
@@ -279,6 +279,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 = '';
|
||||
|
||||
Reference in new issue
Block a user