Re: P1: Content-Length SHOULD be sent

On 28/11/2012, at 11:10 AM, Martin Thomson <martin.thomson@gmail.com> wrote:

> On 27 November 2012 14:58, Mark Nottingham <mnot@mnot.net> wrote:
>> 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 method does not define any meaning for the body (in which case the Content-Length header MAY be sent).
> 
> IANAL, so this was hard to parse for me.  How about:
> 
> --8<--
> The Content-Length header indicates the size of a message body as a
> decimal number of octets.  The sender SHOULD set Content-Length if:
>   o  the message is allowed to contain a body,
>   o  the Transfer-Encoding header field is not included, and
>   o  the size of the message body is known at the time that headers are sent.
> Messages that do not define a meaning for the body MAY either omit the
> Content-Length header field or include a value of 0.
> -->8--

I think that's an improvement, delta some adjustments to align with terminology used elsewhere and a few other editorial tweaks. Read very strictly, there's a question of precedence between the requirements, but the intent is clear enough.

I'll set this as the proposal in the ticket.


> I'm leery of the "SHOULD" still.  It seems weak.  I'd almost go with
> MUST include and a fourth condition: the message size is unknown and
> the end of the body is signaled by closing the connection (in which
> case the Connection header MUST include the 'close' token).


I know what you're saying. However, I'm not sure the improvement is great enough to justify the ensuing discussion and back-and-forth...

Cheers,

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

Received on Tuesday, 4 December 2012 04:41:41 UTC