W3C home > Mailing lists > Public > ietf-http-wg@w3.org > October to December 2012

Re: P1: Content-Length SHOULD be sent

From: Willy Tarreau <w@1wt.eu>
Date: Tue, 4 Dec 2012 17:45:08 +0100
To: Zhong Yu <zhong.j.yu@gmail.com>
Cc: Mark Nottingham <mnot@mnot.net>, Martin Thomson <martin.thomson@gmail.com>, "Roy T. Fielding" <fielding@gbiv.com>, HTTP Working Group <ietf-http-wg@w3.org>
Message-ID: <20121204164508.GA10038@1wt.eu>
On Tue, Dec 04, 2012 at 09:42:47AM -0600, Zhong Yu wrote:
> Yes a GET request can contain Content-Length, but people don't really
> do that. Based on that observation, a server may reject any GET with
> Content-Length, reasoning that it's simpler to program, and it won't
> lose any legitimate requests.
> 
> However the proposed change may encourage new programmers to add
> Content-Length:0 to GET requests. (Actually it seems to be the sole
> motivation for the change)

As I said, I don't think it encourages this due to the paragraph above
explicitly saying that requests without body don't need to send a c-l.
But maybe this could be reinforced in the text, I don't know.

> This change will disturb the existing practices, without adding any value.
> 
> (My real problem with the change is the semantics. A server API may
> want to distinguish between a request with an empty entity body and a
> request without an entity. Previously this can be done uniformly for
> requests, per RFC2616.)

This distinction -if it exists at all- cannot be made based on the presence
of the content-length header field precisely because this one has been
optional for ages due to the compatibility with the close mode. My
understanding has always been that no entity body is an empty body and
conversely.

Regards,
Willy
Received on Tuesday, 4 December 2012 16:45:48 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 4 December 2012 16:45:51 GMT