Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit ca933ce

Browse filesBrowse files
apapirovskiBethGriggs
authored andcommitted
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>
1 parent 49f44f3 commit ca933ce
Copy full SHA for ca933ce

File tree

Expand file treeCollapse file tree

2 files changed

+2
-0
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

2 files changed

+2
-0
lines changed
Open diff view settings
Collapse file

‎lib/internal/http2/core.js‎

Copy file name to clipboardExpand all lines: lib/internal/http2/core.js
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,7 @@ function onSessionHeaders(handle, id, cat, flags, headers) {
220220
}
221221
} else {
222222
stream = new ClientHttp2Stream(session, handle, id, opts);
223+
stream.end();
223224
}
224225
if (endOfStream)
225226
stream[kState].endAfterHeaders = true;
Collapse file

‎test/parallel/test-http2-server-push-stream.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-http2-server-push-stream.js
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ server.listen(0, common.mustCall(() => {
5454
assert.strictEqual(headers['content-type'], 'text/html');
5555
assert.strictEqual(headers['x-push-data'], 'pushed by server');
5656
}));
57+
stream.on('aborted', common.mustNotCall());
5758
}));
5859

5960
let data = '';

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.