Re: Distinguishing 0-byte request body in HTTP/2

Hi Mark,

On Thu, Sep 15, 2016 at 06:47:32PM +1000, Mark Nottingham wrote:
> > Thus I'd suggest that the client
> > always emits the content-length when it considers that semantically it
> > emits a body even if it's empty. Let's imagine a disk backup tool uploading
> > files over HTTP, using a few header fields to pass file name, permissions
> > and various meta-data. Some files may be empty, and regardless of this they
> > are sent. In this case it totally makes sense to emit "content-length: 0".
> > 
> > I'd be tempted to simplify this as "if you're sending a body even an empty
> > one, announce its size in content-length". Methods like POST and PUT expect
> > a message body so that should always be done.
> 
> That's a bit too simple. Keep in mind that for HTTP/1.1,
> 
> "A sender MUST NOT send a Content-Length header field in any message that
> contains a Transfer-Encoding header field."
> <http://httpwg.org/specs/rfc7230.html#header.content-length>

When I'm saying "c-l", I mean "or equivalent" or more precisely "announce the
message length one way or another". I totally agree with you on all this, but
I know that Kazuho is fine as well with language shortcuts like this :-)

Cheers,
Willy

Received on Thursday, 15 September 2016 09:24:31 UTC