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

POST/PATCH with body adds custom headers twice #237

Closed
djmitchella opened this issue Sep 20, 2019 · 1 comment · Fixed by #354
Closed

POST/PATCH with body adds custom headers twice #237

djmitchella opened this issue Sep 20, 2019 · 1 comment · Fixed by #354
Labels
bug Something isn't working pr in review
Milestone

Comments

@djmitchella
Copy link

If I do echo on, cd /api/things, set header my-header abcd, and then do:

GET

I can see my-header: abcd showing up once in the list of headers.

But if I try a POST with a body:

POST -c "hello"

then I get my-header: abcd twice in the list of headers, and if the API I'm talking to doesn't like duplicated headers, I get problems. If I don't supply a body, I don't get the duplicated header, it only shows up once.

Same problem happens with PATCH; if I supply a body, then my custom header gets sent twice.

@tlmii
Copy link
Member

tlmii commented Sep 20, 2019

It looks like the headers are always getting added to the request's headers collection, and then, if there is a body, they're also getting added to the content's headers collection. Thus the duplication. Thanks for the bug report. I'll see about getting a PR out to fix this.

@tlmii tlmii added the bug Something isn't working label Sep 20, 2019
@bradygaster bradygaster added this to the 3.1 milestone Jun 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working pr in review
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants