Closed slotix closed 7 years ago
Hmm, kinda a tricky one actually.
A couple of the keys have 'field values', eg, private
:
https://tools.ietf.org/html/rfc7234#section-5.2.2.6
So an example of where splitting the token after the first ,
, which would break is this:
private=Set-Cookie,Request-Id public
Going off the RFC into the real world, I guess there are "simple" field values, eg, mostly integers, and the there are un-quoted, complex field values, in which splitting by a comma is not a good thing. I'm thinking a whitelist of these keytypes with #field-name
values which are: no-store
, private
Actually I've tested the code with http://yandex.com as an example. It works ok with the last commit. Thank you
Yeah, the PR "fixes" this case, but breaks parsing for the other... so I think i need a bigger change to make it support both
I don't care about this particular website and will stay with master brunch.
As a quick fix I can add spaces by hands after each comma before sending to parser.
So the string will look like no-cache, no-store, max-age=0, must-revalidate
What do you think? I just care about not breaking other things.
If
no-cache,no-store,max-age=0,must-revalidate
is received byfunc parse(value string, cd cacheDirective) error
as a value it reports the following errorstrconv.ParseUint: parsing "0,must-revalidate": invalid syntax