Response trailers, in three framings
RFC 9110 §6.5's trailer fields: what is not knowable until the content has been produced. A checksum, a signature, why a stream stopped early. One `res.trailers` on the shared `Response`, and each driver sends it in the shape it has -- which makes this the four-layer claim again, and the three shapes are a fair summary of the three protocols. HTTP/1.1 needs the chunked coding and §7.1.2's trailer section, which splits the terminator in two: the last chunk, the fields, the empty line. HTTP/2 needs §8.1's second field block with END_STREAM. HTTP/3 needs §4.1's second HEADERS frame with no flag at all, because the stream ends when QUIC says it does. One layer fewer each time. A framing with nowhere to put them drops them, which is specified rather than convenient: §6.6.2 says "a trailer section is only possible when the message framing allows it", and a declared length ends where it said it would. That is also why §6.5.1 forbids putting anything the recipient needs in a trailer -- it may not arrive. Those fields are refused on the way out rather than trusted to a handler that read the section, because anything changing how a message is framed, routed, cached or authenticated arrives too late to be obeyed and is a way to tell a cache one thing and whatever is behind it another. Two things went wrong and both are worth keeping. The HTTP/2 driver sent the trailer section before flushing the body, because `finish` is what flushes and the trailers went out ahead of it. A field section arriving in front of the content it describes is not a subtle failure -- a peer reads it as a second response head -- and the test caught it as an empty body. And the HTTP/2 test oracle read the *last* field section as the response. That was right while the only reason for several was §15.2's interim responses, where the last one is the real one; a trailer section has no `:status` at all, so it reported a response without one. The rule is now the last section carrying `:status`, which handles both. One rule turned out to be unreachable rather than unimplemented: a pseudo-header in a trailer section, which §8.1 forbids and `Headers.append` already refuses, because it validates a name with `token.isToken` and `:` is not a token character. The guard in each driver stays as belt and braces, and the test says why it cannot be exercised from a handler. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0141M41NZ9P4WQsMW41VYZGs