Skip to content

Commit cf86853

Browse files
committed
http2:correct http2 header frame content
previously, due to some error in the content of the header frame, the script could not exit properly, which eventually led to a timeout error,this commit correct header frame content according to http2 related protocol so that make it exited successfully.
1 parent 2d3a1fd commit cf86853

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

test/parallel/test-http2-premature-close.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ async function requestAndClose(server) {
2929
// Send a valid HEADERS frame
3030
const headersFrame = Buffer.concat([
3131
Buffer.from([
32-
0x00, 0x00, 0x0c, // Length: 12 bytes
32+
0x00, 0x00, 0x0e, // Length: 12 bytes
3333
0x01, // Type: HEADERS
34-
0x05, // Flags: END_HEADERS + END_STREAM
34+
0x04, // Flags: END_HEADERS + END_STREAM
3535
(streamId >> 24) & 0xFF, // Stream ID: high byte
3636
(streamId >> 16) & 0xFF,
3737
(streamId >> 8) & 0xFF,
@@ -41,7 +41,7 @@ async function requestAndClose(server) {
4141
0x82, // Indexed Header Field Representation (Predefined ":method: GET")
4242
0x84, // Indexed Header Field Representation (Predefined ":path: /")
4343
0x86, // Indexed Header Field Representation (Predefined ":scheme: http")
44-
0x44, 0x0a, // Custom ":authority: localhost"
44+
0x41, 0x09, // Custom ":authority: localhost"
4545
0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x68, 0x6f, 0x73, 0x74,
4646
]),
4747
]);

0 commit comments

Comments
 (0)