Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Difficult to use when multiple Set-Cookie received #50

Open
lilydjwg opened this issue Jul 22, 2014 · 5 comments
Open

Difficult to use when multiple Set-Cookie received #50

lilydjwg opened this issue Jul 22, 2014 · 5 comments
Assignees
Milestone

Comments

@lilydjwg
Copy link

When there are duplicate headers, http-parser concatenates them with ', '. This makes it difficult to parse the individual cookies, e.g.:

Key1=Value1; path=/; expires=Fri, 19-Jul-24 03:30:12 GMT, Key2=Value2; path=/

Splitting on ', ' won't work. Though it can be parsed, but for other headers (maybe non-standard ones) it'll become impossible. If it's too late to make the value a list or something, what about a user-provided header callback that will run on each complete header line?

@lilydjwg
Copy link
Author

RFC 6265 says:

Origin servers SHOULD NOT fold multiple Set-Cookie header fields into a single header field. The usual mechanism for folding HTTP headers fields (i.e., as defined in [RFC2616]) might change the semantics of the Set-Cookie header field because the %x2C (",") character is used by Set-Cookie in a way that conflicts with such folding.

A way to bypass this kind of folding sounds useful in some cases.

Repository owner deleted a comment from Ousret Apr 17, 2020
@benoitc
Copy link
Owner

benoitc commented Apr 17, 2020

@Ousret i deleted your comment. Either you participate there or not. But shameless advertising is not tolerated. You can contact me privately if you want to see how we can eventually improve headers handling.

@Ousret
Copy link

Ousret commented Apr 17, 2020

Sorry. @benoitc Wasn't trying to harm anyone. I do not consider sharing open-source work that actually resolves actual problems as "shameless advertising". But I respect your opinion nonetheless. 🍻 cheers.
Regards

@benoitc
Copy link
Owner

benoitc commented Apr 17, 2020

@Ousret I can accept a pr with a sample of usages over the lib...

@Ousret
Copy link

Ousret commented Apr 17, 2020

Ok 👍 I will, sometime this w-e-. 👍

@benoitc benoitc self-assigned this Apr 17, 2020
@benoitc benoitc added this to the 0.10.0 milestone Apr 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants