You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(mux-h1): bytes written after the head of a response without a body to an H1 client #1761
A response to HEAD, a 204 or a 304 has no body by definition (RFC 9110 §9.3.2, §15.3.5, §15.4.5), and an HTTP/1.1 recipient reads it as ending with its header section (RFC 9112 §6.3).
When an H2 backend sends such a response's HEADERS without END_STREAM and without content-length, the response is framed as chunked, and the end of the stream (a trailer HEADERS frame or an empty DATA frame) is written to an H1 client as a last chunk 0\r\n, the trailer fields and an empty line after the head. On a keep-alive connection the client reads those bytes as the start of the next response.
Expected: nothing is written after the head of such a response towards an H1 client; its trailer fields are discarded (RFC 9110 §6.5.1).
Follows #1730, which covers the Content-Length-framed case.
Activity
fix(mux-h1): write nothing after the head of a response without a body
docs(mux-h1): narrow the bodiless-response framing claim
fix(mux-h1): write nothing after the head of a response without a body
docs(mux-h1): narrow the bodiless-response framing claim
fix(mux-h1): write no last chunk or trailers after the head of a resp…