Skip to content
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

Bug with cookies authorization #760

Closed
romanleshukov opened this issue Apr 8, 2020 · 2 comments
Closed

Bug with cookies authorization #760

romanleshukov opened this issue Apr 8, 2020 · 2 comments

Comments

@romanleshukov
Copy link

Hi,

I have found a bug, which prevented establishing an authorized connection to server. We are using auth cookies. It is in the file: HTTPHandler.swift, method: createUpgrade, and the code:

if let cookies = HTTPCookieStorage.shared.cookies(for: url), !cookies.isEmpty {
    let headers = HTTPCookie.requestHeaderFields(with: cookies)
    for (key, val) in headers {
        req.setValue(key, forHTTPHeaderField: val)
    }
}

It should be:

req.setValue(val, forHTTPHeaderField: key)

Best regards,
Roman

@daltoniam
Copy link
Owner

Ah thanks. Total oversight on my part. Fixed in 4.0.3 (just released).

@romanleshukov
Copy link
Author

Thank you!

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

No branches or pull requests

2 participants