You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Actually, we'll deliberately ignore all cookies set with the Set-Cookie header when printing the cURL description via RealHTTP. It's annoying; sometimes, it's helpful to set cookies in this manner instead of creating an NSHTTPCookie object.
In this task, we'll remove the where condition when printing header cookies.
privatestaticfunc addHeaders(for request:URLRequest, whenIn client:HTTPClient, into components:inout[String]){letconfiguration= client.session.configuration
varheaders=HTTPHeaders()
for header in configuration.headers where header.name !="Cookie"{headers[header.name]= header.value
}
for header in request.headers where header.name !="Cookie"{headers[header.name]= header.value
}
for header in headers {letescapedValue= header.value.replacingOccurrences(of:"\"", with:"\\\"")
components.append("-H \"\(header.name.rawValue): \(escapedValue)\"")}}
Other Information
No response
The text was updated successfully, but these errors were encountered:
malcommac
changed the title
[Feature]: Print Cookie in cURLDescription() when cookies are set via explicit header
[Feature]: Cookies set in Set-Cookie header are now printed in cURLDescription() (along with any set in NSHTTPCookieStorage)
Feb 17, 2023
What problem are you facing?
Actually, we'll deliberately ignore all cookies set with the
Set-Cookie
header when printing the cURL description via RealHTTP. It's annoying; sometimes, it's helpful to set cookies in this manner instead of creating anNSHTTPCookie
object.In this task, we'll remove the
where
condition when printing header cookies.Other Information
No response
The text was updated successfully, but these errors were encountered: