Skip to content

Implementation of HTTPCookie.cookies(withResponseHeaderFields:forURL:) #423

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
Jun 28, 2016
Merged

Implementation of HTTPCookie.cookies(withResponseHeaderFields:forURL:) #423

merged 1 commit into from
Jun 28, 2016

Conversation

pushkarnk
Copy link
Member

@pushkarnk pushkarnk commented Jun 24, 2016

This is for an initial implementaion of HTTPCookie.cookies(withResponseHeaderFields:forURL:).
In addition to the contributed unit tests, I have also tested this code against cookies
returned by some of the twenty most popular websites.

Kindly review and provide feedback.

This if for an initial implementaion of HTTPCookie.cookies(withResponseHeaderFields:forURL:).
In addition to the contributed unit tests, I have also tested this code against cookies
returned by some of the twenty most popular websites. Kindly review and provide feedback.
//Bake a cookie
private class func createHttpCookie(url: URL, pairs: [String], start: Int, end: Int) -> HTTPCookie? {
var properties: [String:Any] = [:]
for index in start..<end {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason not to just use for aPair in pairs?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I see, we're parsing a subset of the array. I think it might be cleaner to just pass an ArraySlice into this.

@parkera
Copy link
Contributor

parkera commented Jun 28, 2016

This looks great, thanks. I'm going to kick off a test run while I review further.

@parkera
Copy link
Contributor

parkera commented Jun 28, 2016

@swift-ci please test

@parkera parkera merged commit 74edb43 into swiftlang:master Jun 28, 2016
@pushkarnk
Copy link
Member Author

Thanks, I'll continue working on the improvements you suggested

@pushkarnk pushkarnk deleted the nshttpcookie branch July 13, 2016 16:37
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.

2 participants