$ the-wire · showcase
Detached onread buffers, a dedup bug that merged requests, and http2 setHeaders
By RepoJournal · Filed · About Node.js · Composed from the cited sources · methodology
Node's stream layer stopped reusing a raw address after the application detaches its onread buffer, while undici fixed a deduplicate interceptor that was returning one caller's response to another.
stream: stop reusing a detached onread buffer nodejs/node
CustomBufferJSListener stored only the raw uv_buf_t address of a user-supplied onread buffer, never the backing store, so a callback that transfers the buffer (for example by enqueuing a view into a byte ReadableStream) left that address dangling and subsequent peer data was read into memory the application owns. The listener now stops reusing a detached buffer.
fix(deduplicate): do not deduplicate requests with a body nodejs/undici
The deduplicate interceptor built its key from origin, method, path and headers but not the body, and undici permits a body on GET, so two concurrent requests to the same URL with different bodies were merged: only the first body reached the server and the second caller got the first caller's response. Search APIs such as Elasticsearch's _search hit this directly; requests with a body are no lo...
fix(fetch): preserve falsy abort reasons nodejs/undici
Fetch.abort tested the abort reason with `if (!error)`, so `false`, `0` and `''` were treated as absent and replaced with a generic AbortError DOMException; the Fetch Standard says the supplied error is what the body and pending fetch reject with. The fallback now applies only when the reason is undefined, and `controller.abort()` with no argument still throws AbortError.
http2: add missing setHeaders nodejs/node
Http2ServerResponse gains setHeaders() to match http.OutgoingMessage.setHeaders(), including set-cookie handling consistent with the HTTP implementation. It supersedes an earlier attempt and takes a fresh single commit with both authors' DCO sign-offs.
feat(decompress): add preserveHeaders option nodejs/undici
The decompress interceptor takes a preserveHeaders option, defaulting to false, that keeps Content-Encoding and Content-Length in both the normalized headers and controller.rawHeaders while still decoding the body, which lets jsdom reuse the interceptor for XMLHttpRequest. Smaller items: gc-http-client tests were reworked to cap concurrency after loaded macOS hosts pushed past 128 connections a...