Skip to content

HTTPCookie: parse domain according to RFC #2373

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

Merged
merged 1 commit into from
Jul 15, 2019

Conversation

drodriguez
Copy link
Contributor

When the domain field is specified, the cookie is intended for the
domain and subdomains, so the value of domain has to be prefixed by a
dot.

Added tests to check for this behaviour and modified the incorrect
tests.

NOTE: I checked this behaviour in macOS 13.14.5, and it matches Foundation there.

@drodriguez
Copy link
Contributor Author

@swift-ci please test

1 similar comment
@pushkarnk
Copy link
Member

@swift-ci please test

@millenomi
Copy link
Contributor

@swift-ci please test

@millenomi
Copy link
Contributor

millenomi commented Jul 5, 2019

@drodriguez This patch needs conflict resolution before merging.

When the domain field is specified, the cookie is intended for the
domain and subdomains, so the value of domain has to be prefixed by a
dot.

Added tests to check for this behaviour and modified the incorrect
tests.
@drodriguez drodriguez force-pushed the cookies-canonical-domain branch from 29f9550 to 84d0b3a Compare July 8, 2019 23:22
@drodriguez
Copy link
Contributor Author

Conflicts resolved.

@swift-ci please test Linux platform

@spevans
Copy link
Contributor

spevans commented Jul 9, 2019

@swift-ci test linux

@drodriguez
Copy link
Contributor Author

@swift-ci please test Linux platform

@millenomi millenomi merged commit 738a647 into swiftlang:master Jul 15, 2019
@compnerd
Copy link
Member

compnerd commented Jul 16, 2019

This broke the Windows build :-(. https://dev.azure.com/compnerd/windows-swift/_build/results?buildId=4605&view=logs&j=b9e62f99-1a98-5ed7-01d2-f4794231ed79

D:/a/1/s/swift-corelibs-foundation/Foundation/HTTPCookie.swift:622:17: error: use of unresolved identifier 'in_addr'
        var x = in_addr()
                ^~~~~~~
D:/a/1/s/swift-corelibs-foundation/Foundation/HTTPCookie.swift:623:16: error: use of unresolved identifier 'inet_pton'
        return inet_pton(AF_INET, string, &x) == 1
               ^~~~~~~~~
D:/a/1/s/swift-corelibs-foundation/Foundation/HTTPCookie.swift:623:26: error: use of unresolved identifier 'AF_INET'
        return inet_pton(AF_INET, string, &x) == 1
                         ^~~~~~~

@drodriguez
Copy link
Contributor Author

I saw that yesterday. I was trying to rebuild everything in Windows to try to fix it. It might be a missing import of WinSDK, or a slightly different functiin name. I will try to finish that today.

@drodriguez drodriguez deleted the cookies-canonical-domain branch July 16, 2019 20:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants