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:
parent
e758d4ab0a
commit
e72c6af6c8
@ -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 = '';
|
||||
|
Loading…
x
Reference in New Issue
Block a user