Re: #305 Header ordering

On Thu, Nov 21, 2013 at 12:58 PM, Martin Thomson

> On 21 November 2013 12:54, Roberto Peon <> wrote:
> > #3 doesn't work for cookie/setcookie, whereas #1 works for everything.
> You already require special code for these two:

That is an optimization for Cookie which can safely be ignored in


#1 solves the problem of concatenation for set-cookie since '\0' is always
disallowed in header values-- with #1, set-cookie is no longer special.

> > #3 also requires parsing quoted-strings, which is painfully annoying,
> It does not, it only requires concatenation at the encoder.  Once
> concatenated, the field is semantically equivalent and therefore
> doesn't need to be re-split.

True so long as the values are well formed, but at the decoder:
With #1, to tokenize (but not necessarily interpret), I simply split on
With #3, to tokenize (but not necessarily interpret), I must parse the
value for quoted strings and split on ','s which are outside those strings.
There are good reasons for one to wish to tokenize and not interpret
(logging, computing differences, etc.).

>From a security perspective, with #1 it is more difficult to get a
malformed quoted-string to interact with the rest of the header fields.

Received on Thursday, 21 November 2013 21:24:01 UTC