Skip to content

HTTP/1 server: option to send trailers the client didn't ask for #4260

Open

Description

@derekargueta

Since trailers were added to the HTTP/1 server, it has sent a response's trailers only when both of these hold:

  • the request had TE: trailers;
  • the response's Trailer header names them.

That's a reasonable default. A proxy, though, passes on whatever trailers its upstream sends. It can't know their names before they arrive, so it can't write a Trailer header, and clients often omit TE: trailers. Envoy's HTTP/1 codec, with enable_trailers, writes all of a chunked response's trailers regardless of either header.

Would you take a server option, http1::Builder::always_send_trailers(bool), default false? It would skip both checks. Fields that aren't allowed in trailers would still be dropped. I have a branch ready.

Activity

  1. GauravPawar101 commented on Nov 9, 2026

    @GauravPawar101

    Hey, I would like to work on this

  2. cratelyn commented on Nov 9, 2026

    @cratelyn
    Member

    @GauravPawar101, i don't think that would be a good use of your time. this issue is blocked on discussion reaching consensus, rather than implementation. the original post notes that they already have a branch ready, should we decide to move forward with this proposal. thank you for offering, though!

  3. seanmonstar commented on Nov 9, 2026

    @seanmonstar
    Member

    Hm, after taking another look at trailers defined in RFC 9110, it seems the Trailer header is meant as a hint, not as an absolute. So, I don't even know if an option should be required, perhaps we just stop enforcing the hint. The hint is meant for the user code anyways. What do we think?

  4. GauravPawar101 commented on Nov 10, 2026

    @GauravPawar101

    Thanks for the heads up

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