We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1d5293d commit b07f7b2Copy full SHA for b07f7b2
templates/swift/Sources/Extensions/HTTPClientRequest+Cookies.swift.twig
@@ -15,8 +15,12 @@ extension HTTPHeaders {
15
let cookies: [HTTPClient.Cookie?]? = try? cookieJson?.fromJson(to: [HTTPClient.Cookie].self)
16
?? [(try? cookieJson?.fromJson(to: HTTPClient.Cookie.self))]
17
18
- if let authCookie = cookies?.first(where: { $0?.name.starts(with: "a_session_") == true } ) {
19
- add(name: "cookie", value: "\(authCookie!.name)=\(authCookie!.value)")
+ var cookiesValue = ""
+ for cookie in cookies ?? [] {
20
+ if let cookie = cookie {
21
+ cookiesValue += "\(cookie.name)=\(cookie.value);"
22
+ }
23
}
- }
24
+ add(name: "Cookie", value: cookiesValue)
25
+}
26
0 commit comments