-
Notifications
You must be signed in to change notification settings - Fork 184
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
Use cookie_store crate instead of cookie::CookieJar #169
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does subtly change out behavior which could be a breaking change. However being more correct might be worth it.
Cargo.toml
Outdated
@@ -39,6 +39,7 @@ serde = { version = "1", optional = true } | |||
serde_json = { version = "1", optional = true } | |||
encoding = { version = "0.2", optional = true } | |||
native-tls = { version = "0.2", optional = true } | |||
cookie_store = "0.12.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to be optional on the cookie feature or we pull in the deps for all features.
I agree it's a bit of a breaking change depending on use cases. To enumerate the changes:
That last one is probably the most likely to break people, since someone could depend on it without realizing it was broken behavior. |
I say let's merge it. |
CookieJar doesn't support the path-match and domain-match algorithms from RFC 6265, while cookie_store does.
This fixes some issues with the cookie matching algorithm currently in ureq. For instance,
the domain-match uses substring matching rather than the RFC 6265 algorithm.
This deletes two tests:
match_cookies_returns_nothing_when_no_cookies didn't test much
agent_cookies was failing because cookie_store rejects cookies on the
test:
scheme. The way around this is to set up a testserver - but it turns out cookies_on_redirect already does that, and covers the same cases and more.