-
Notifications
You must be signed in to change notification settings - Fork 47
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
Fixed parsing of comma separated multiple cookies in one header field #30
base: master
Are you sure you want to change the base?
Conversation
This has the potential to break existing implementations. A safer approach would be to allow both the colon and the comma as delimiters. Either that or bump the major version of the library if the change is merged. |
I am open to discuss this, and I am willing to make a major version bump if we need to fix something to be RFC compliant. First, (and this isn't really directed at you @Smert, but is something I'd like a change like this to fix up) that regex is defined quite a ways away from where it's actually used: Secondly, my reading is that the Cookie.parse method is meant to work on a single cookie, and is doing so correctly. I think the CookieJar.setCookies method is the only place where we are splitting the cookie string according to the RFC, which states:
So that would seem to indicate to me that this is actually a good change. @danielmcq, I feel like maybe this is worth a major version bump, thoughts? @Smert How about moving the regex closer to where it's actually used as part of this change? I was a bit confused by its current placement in the code. |
@andyburke It should be noted that Might be a problem with commas in
|
@andyburke Definitely in favor of a major version bump. Even though the behavior was incorrect according to standards, it's been that way for long enough in this library that fixing it would mean that there are plenty of people that would need to make changes to how they've been using it. A major version would help indicate that there may be changes needed in their code before upgrading. |
ae49415
to
0a2fb98
Compare
What do you think about this fix?
https://tools.ietf.org/html/rfc2965