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

Duplicate header keys from request.debugDescription #1303

Closed
mrubin opened this issue Jun 10, 2016 · 2 comments
Closed

Duplicate header keys from request.debugDescription #1303

mrubin opened this issue Jun 10, 2016 · 2 comments
Assignees
Milestone

Comments

@mrubin
Copy link

mrubin commented Jun 10, 2016

When I print request.debugDescription from a multipart upload request (I'm guessing it doesn't matter what kind of request this is), I'm noticing duplicate fields:

$ curl -i \
    -X POST \
    -H "Content-Type: multipart/form-data; boundary=alamofire.boundary.ac7f77e2ea014347" \
    -H "Content-Type: application/json" \
    "http://..."

Looking at the code, I'm guessing that perhaps by using NSObject as the dictionary key instead of something like String, we are putting different NSObjects in there (one from session.configuration.HTTPAdditionalHeaders and one from request.allHTTPHeaderFields), and the request-specific ones aren't overwriting the session-specific ones, as is the intention.

@cnoon
Copy link
Member

cnoon commented Jun 12, 2016

Thanks for reporting this @mrubin. We already have some tests put together around this use case, but not for MultipartFormData requests. I'll add one and see if I can get to the bottom of this.

@cnoon
Copy link
Member

cnoon commented Jun 12, 2016

Okay @mrubin, I've added a test in 53e25d5 that verifies the debugDescription on a Request works correctly even for MultipartFormData requests. At this point I'm going to close this issue out. If you could provide a sample project (or better yet, a test) that can reproduce the behavior you are seeing, then I'll be happy to re-open and investigate further.

Cheers. 🍻

@cnoon cnoon closed this as completed Jun 12, 2016
@cnoon cnoon modified the milestones: 3.4.1, 3.5.0 Jun 13, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants