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

P1: Content-Length SHOULD be sent

From: Mark Nottingham <mnot@mnot.net>
Date: Tue, 27 Nov 2012 16:21:25 +1100
Message-Id: <6B2AE18D-643B-470A-9C79-B167BE50D15A@mnot.net>
To: HTTP Working Group <ietf-http-wg@w3.org>
Currently, p1 says:

> When a message is allowed to contain a message body, does not have a Transfer-Encoding header field, and has a payload body length that is known to the sender before the message header section has been sent, the sender should send a Content-Length header field to indicate the length of the payload body as a decimal number of octets.

This unqualified SHOULD leads people to convoluted readings of the spec where Content-Length is required to be sent on a GET request:
  https://github.com/kennethreitz/requests/issues/223#issuecomment-10745532

Proposal:

> When a message is allowed to contain a body, does not have a Transfer-Encoding header field, and has a payload body length that is known to the sender before the message header section has been sent, the sender should send a Content-Length header field to indicate the length of the payload body as a decimal number of octets, unless the message is a request and the payload length is zero (in which case the Content-Length header MAY be sent). 


--
Mark Nottingham   http://www.mnot.net/
Received on Tuesday, 27 November 2012 05:21:51 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 27 November 2012 05:21:55 GMT