ninenines / cowlib

Support library for manipulating Web protocols.
ISC License
279 stars 173 forks source link

'=' and '/' to lists exceptions in 'parse_cookie/2' function 'cow_coo… #110

Closed Shpaky closed 3 years ago

Shpaky commented 3 years ago

…kie' module

essen commented 3 years ago

The slash is most definitely allowed, see https://tools.ietf.org/html/draft-ietf-httpbis-rfc6265bis-07#section-4.1.1

The equal is already handled in parse_cookie_name.

essen commented 3 years ago

To be clear the function does need to be revised, to not crash for example (so perhaps the equal can be handled the way you did, but the clause in parse_cookie_name must be removed), and to conform to the spec.

Shpaky commented 3 years ago

Thanks! But '=' necessary handle to 'parse_cookie/2' since here:

https://github.com/ninenines/cowlib/blob/master/src/cow_cookie.erl#L66

will be crash if "=" it is name of cookie!