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

Setting Content-Type header without regard for the payload type causes issues #19

Open
Jmennius opened this issue Aug 2, 2024 · 1 comment

Comments

@Jmennius
Copy link
Contributor

Jmennius commented Aug 2, 2024

For example, I am doing a PUT with a large binary payload (and not setting content-type explicitly because nobody cares about it).
Some of the tests use a mock (moto), which in turn uses werkzeug and it will try to interpret the form data.. which is not parseable in this case...
I am not sure why we set Content-Type here at all, it does not seem to be required?

@Jmennius Jmennius changed the title Setting Content-Type header without regard for the payload type causes issues Setting Content-Type header without regard for the payload type causes issues Aug 2, 2024
@andrewjroth
Copy link
Owner

You are correct, the Content-Type header is not required. I'm not sure why it was originally included -- perhaps it was a convenience for some AWS service that might require it, but I can't recall which service anymore.

The requirement is this:

If the Content-Type header is present in the request, you must add it to the CanonicalHeaders list.

I'll add this to my todo to fix in the future. If you have the bandwidth, please submit a PR with this change.

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

No branches or pull requests

2 participants