Skip to content

fix(mux-h1): bytes written after the head of a response without a body to an H1 client #1761

Closed

Description

@FlorentinDUBOIS

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

  1. added 4 commits that reference this issue on Oct 1, 2026
    8d14110
    16511a7
    d1c6951
    7ba9128
  2. added a commit that references this issue on Oct 2, 2026
    ecac9f4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions