-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Various Cookie fixes #1700
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
Various Cookie fixes #1700
Conversation
- Add support for additional Set-Cookie formats that web servers can return - Properly handle HTTP header parsing to extract values since values can contain colons - Make sure to set cookies on redirect requests - Use setValue instead of addValue when applying cookies to requests otherwise, Cookie header might contain: cookie1=value1,cookie1=value1; cookie2=value2 - New unit tests for cookie formats and redirect with Set-Cookie
@mamabusi, @ianpartridge, @spevans, please kindly review this change. Thank you! :) |
@swift-ci test |
@swift-ci, could this please be retested? Looks like the build failed in files not touched by my commit... Thanks! |
@swift-ci test |
Glad to see we're actually testing on macOS now. We can merge this if others approve and address those separately. |
@mamabusi, @ianpartridge, could I please get a review? Thanks! |
This all looks sensible to me, but I can't comment on compatibility with Darwin. Does Foundation on Darwin support the extra Set-Cookie formats, for example? |
@ianpartridge, yes, I checked against swift 4.2 release on Darwin and indeed it does support these four cookie formats. Thanks! |
LGTM. |
@swift-ci please test and merge |
Thanks @mamabusi and @ianpartridge! @ianpartridge, I would like to get this into the next 4.2.x release. Is swift-4.2-branch the correct one for the 4.2.x release? Thanks! |
Yes I think so - @parkera can confirm that that branch is still accepting fixes. |
It looks like this broke Ubuntu 14.04; please fix that first! https://ci.swift.org/job/oss-swift-incremental-RA-linux-ubuntu-14_04/5915/ |
@jrose-apple, the compiler error appears to be unrelated to my changes: Looks like a setup issue? I'm surprised Ubuntu 16.04 builds just fine. |
No, that's an unrelated error we haven't tracked down, but not a fatal one. Here's the actual error:
|
@jrose-apple do we need to revert this PR while we figure out the 14.04 test failure? |
Given the use of dates in the tests, it could be ICU on 14.04 causing problems. The usual fix is to disable the tests |
@jrose-apple, sorry I didn't catch this error. I will have a fix shortly. Thanks for your help in identifying the failure! |
@jrose-apple, here's the fix for Ubuntu 14.04: #1707 Thanks! Can swift-ci test on Ubuntu 14.04 please? |
Cookie header might contain: cookie1=value1,cookie1=value1; cookie2=value2