Subject: T-E chunked trailers

From: Ashok Kumar <[email-masked]>
Date: Fri, 10 Feb 2017 11:56:32 +0530

Hi All,

rfc7230#section-4.4 talks about the Trailer header for Chunked T-E.

I need some clarity on expected behavior from server,

When a User-Agent sends a POST request with Chunked body and includes a
Trailer header (say with value content-md5) in the request headers, but
doesn't include any trailers after the zero chunk in the POST body.

Should this be an error or can this be ignored?

Since none of the mandatory headers can be present, I feel that this can be
ignored,

But on the other hand, content-md5 not getting generated could be some
middle box modifying the content and stripping off the trailer?

Thanks in advance,
Ashok

---

From: Mark Nottingham <[email-masked]>
Date: Fri, 10 Feb 2017 18:47:38 +1100

If you're worried about a middlebox and the connection isn't encrypted, it's really game over; they can modify anything.

Cheers,

> On 10 Feb 2017, at 5:26 pm, Ashok Kumar <[email-masked]> wrote:
> 
> Hi All,
> 
> When a User-Agent sends a POST request with Chunked body and includes a Trailer header (say with value content-md5) in the request headers, but doesn't include any trailers after the zero chunk in the POST body.
> 
> Since none of the mandatory headers can be present, I feel that this can be ignored, 
> 
> But on the other hand, content-md5 not getting generated could be some middle box modifying the content and stripping off the trailer?
> 
> 
> Thanks in advance,
> Ashok

--
Mark Nottingham   https://www.mnot.net/

---

From: Willy Tarreau <[email-masked]>
Date: Fri, 10 Feb 2017 12:39:32 +0100

Hi,

> Should this be an error or can this be ignored?

There is no reason why it should be an error, the Trailer header field
only notifies the recipient that it should be prepared to receive trailers.
It is more or less comparable to the Connection header field but for
trailers. However if the recipient absolutely needs this trailer, it's
a different story of course.

> Since none of the mandatory headers can be present, I feel that this can be

You just need the empty line to mark the end of the trailers anyway.

> middle box modifying the content and stripping off the trailer?

Definitely, or simply stripping it without touching the content. But see
Mark's response regarding this anyway.

Willy