Alamofire icon indicating copy to clipboard operation
Alamofire copied to clipboard

cookies not shown in cURLRepresentation

Open kiruto opened this issue 6 years ago • 1 comments

What did you do?

When disabled cookies in session manager config like:

let configuration = URLSessionConfiguration.default
configuration.httpAdditionalHeaders = Alamofire.SessionManager.defaultHTTPHeaders
configuration.httpShouldSetCookies = false

Then set a cookies use request header like:

let header = HTTPCookie.requestHeaderFields(with: cookies)
request(url, method: method, parameters: parameters, encoding: encoding, headers: header)

Then the cookies will not shown in Request.cURLRepresentation function.

What did you expect to happen?

Show cookies when called cURLRepresentation().

What happened instead?

The cookies witch set in header will not shown in Request.cURLRepresentation function.

Alamofire Environment

Alamofire version: ~> 4.5 Xcode version: 9.2 Swift version: 4.0 Platform(s) running Alamofire: iOS macOS version running Xcode: 10.13.2

kiruto avatar Feb 14 '18 03:02 kiruto

I created a pull request for fix this https://github.com/Alamofire/Alamofire/pull/2436

kiruto avatar Feb 14 '18 03:02 kiruto