SIGN IN SIGN UP
oven-sh / bun UNCLAIMED

Incredibly fast JavaScript runtime, bundler, test runner, and package manager – all in one

0 0 150 Rust

node:http2: send GOAWAY frames on stream 0 (#31353)

RFC 9113 section 6.8 requires GOAWAY frames to be sent with a stream
identifier of 0 in the frame header; the last processed stream id
belongs in the GOAWAY payload. The node:http2 server's frame writer was
putting the triggering stream's id in the frame header instead, so
conforming peers (including Bun's own client) treated every
server-initiated GOAWAY as a connection protocol error and never saw the
real error code.

This hardcodes the GOAWAY frame header's stream identifier to 0 and
keeps the triggering stream id as a diagnostics-only parameter. The
payload layout (last-stream-id + error code + debug data) is unchanged.

Tests added to test/js/node/http2/node-http2.test.js: a wire-level test
that parses the GOAWAY frame a server emits after a protocol violation
and asserts the header stream id is 0 while the payload still carries
the right error code, and an end-to-end test that a client receives the
'goaway' event with the server's error code instead of a session error.
Both fail without the fix.
J
Jarred Sumner committed
af054d47db6b82060a457697f2df042202f07eb8
Parent: 81a811b
Committed by GitHub <noreply@github.com> on 5/24/2026, 8:45:16 PM