OWS before chunk

2616 defined a chunk as:

>        chunk          = chunk-size [ chunk-extension ] CRLF
>                         chunk-data CRLF

Keeping in mind that it had implied whitespace, we changed to:

>      chunk          = chunk-size *WSP [ chunk-ext ] CRLF
>                       chunk-data CRLF

In both cases, the entire body of a chunked message is defined as:

>      Chunked-Body   = *chunk
>                       last-chunk
>                       trailer-part
>                       CRLF

Now, it's sensible that there isn't any whitespace allowed between the CRLFs and chunk-data, since it's counted.

However, I'm seeing responses in the wild (through redbot) where there is OWS (e.g., an extra line) between the CLRF of one chunk and the chunk-size of the next.

Most of them seem to be caused by one Web server; AFAICT all common clients recover from this.

Should chunk really be:

>      chunk          = OWS chunk-size *WSP [ chunk-ext ] CRLF
>                       chunk-data CRLF

(with a corresponding change in last-chunk)


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

Received on Thursday, 27 October 2011 11:07:42 UTC