Re: #305 Header ordering

Wouldn't it be the higher-layers only that need to parse quoted-strings
today?  Many loadbalancers need-not parse quoted-strings today, for
instance: it is unlikely that any field they care about examining allows
quoted-strings...

At least in my implementation, the data within the header fields (which
might include quoted-strings) are provided by the application which
manipluates a headers object. The headers object or lower never needs to
parse the field in the outbound path.
On the reverse side, the IO library+framer feeds the keys/values into a
header object. It doesn't tokenize-- that is left to the application. The
framer/headers object never needs to parse the fields in the inbound path.

Setting that point aside, how would I deal with the following response
headers in the #3 proposal?
  Set-Cookie: name1=value1; Expires=Wed, 09 Jun 2021 10:18:14
  Set-Cookie: name2=value2; Expires=Thu, 10 Jun 2021 10:18:14
  Set-Cookie: name3=value3; Expires=Fri, 11 Jun 2021 10:18:14

With proposal #1, an encoder can simply do:
  Set-Cookie: name1=value1; Expires=Wed, 09 Jun 2021
10:18:14\0name2=value2; Expires=Thu, 10 Jun 2021 10:18:14\0name3=value3;
Expires=Fri, 11 Jun 2021 10:18:14

With #3, attempting to use the #3 mechanism requires a context-aware parser
(ick):
  Set-Cookie: name1=value1; Expires=Wed, 09 Jun 2021 10:18:14,name2=value2;
Expires=Thu, 10 Jun 2021 10:18:14,name3=value3; Expires=Fri, 11 Jun 2021
10:18:14
or it requires the encoder to send these as separate header fields.

Much of the time, there isn't a good reason to want to send these as
separate header fields.

-=R



On Sat, Nov 23, 2013 at 1:11 PM, Martin Thomson <martin.thomson@gmail.com>wrote:

> On 22 November 2013 22:38, Roberto Peon <grmocg@gmail.com> wrote:
> > How about replacing all ','s with '\0's?
> > '\0' is a disallowed character everywhere, unlike ',' which requires
> special
> > parsing because of quoted strings.
> > I'd rather that the lower layers of the protocol stack not have to do
> quoted
> > string parsing.
>
> As proposed, you don't need to parse unless you are interpreting the value.
>
> What you propose here would force lower layers of the stack to parse
> quoted strings to determine where to replace ',' with '\0'.  That
> sounds worse to me.
>

Received on Saturday, 23 November 2013 21:33:32 UTC