Re: draft-ietf-httpbis-header-structure: handling multiple field values

On Tue, May 12, 2020 at 09:22:31PM +0000, Poul-Henning Kamp wrote:
> PS: I think your example is wrong, the combined header would be:
> 
>     Foo: "a,b"
> 
> Because there is an important asymmetry in RFC7230/3.2.2.
> 
> A sender is required to know the syntax of the header is a comma
> separated list, before can split the header.
> 
> A receiver on the other hand is under no such obligation, and therefore
> 
>    "...by appending each subsequent field value to
>    the combined field value in order, separated by a comma."
> 
> should be interpreted narrowly:  Only a comma, not whitespace.

Yes it is valid because whitespaces before and after the value are not
part of the value itself, so:

   Foo: b
   Foo:    b

are equivalent, as such you can simply fold using a comma and whatever
number of spaces. I remember a very old discussion where someone suggested
that some limited equipements that must not change the size could replace
the CR with the comma and the LF plus all subsequent chars of the header
field name and the colon with spaces and have it done.

In haproxy we used to replace the CR by comma, the LF with a space,
and memmove the value. Now we're simply folding using <comma> <space>.

Cheers,
Willy

Received on Tuesday, 12 May 2020 21:35:38 UTC