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

Content-Type duplication in POST requests #568

Closed
DiogoP98 opened this issue Aug 24, 2023 · 1 comment · Fixed by #614
Closed

Content-Type duplication in POST requests #568

DiogoP98 opened this issue Aug 24, 2023 · 1 comment · Fixed by #614
Labels

Comments

@DiogoP98
Copy link

Screenshot

Description

When making a POST request with a content-type header, a new Content-Type header is added to the request because the map is not case insensitive. This is leading to MIME erros when querying some APIs.
This goes against the best-practices as headers' field names should be case insensitive.

Ref: https://www.rfc-editor.org/rfc/rfc2616.html#section-4.2:~:text=Field%20names%0A%20%20%20are%20case%2Dinsensitive

Reproduction Steps/Repo Link

  • Make a POST request with a JSON body and a content-type header
  • The new header Content-Type will be added
@jonkoops
Copy link
Collaborator

This is leading to MIME erros when querying some APIs.

Note that this is also a bug in these APIs, as they also should treat headers in a case-insensitive manner. Still, this should probably be corrected on the side of the client.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants