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
Undocumented change to body-less POST request Content-Type? #1193
Comments
Looking into this further, it looks like this was a change between v0.16.1 and v0.16.2, and in fact is a consequence of #930. Changing the method in the code sample to I'm not really sure whether to call this a breaking change, so I will defer to you on that. Presumably technically the code above was considered incorrect pre-0.16.2 because it specified |
I did encounter a bug related to it. When using a transform request in POST request, the Content-type header automatically sets to |
This also breaks PUT when uploading to a presigned S3 URL, since the URL I'm uploading to is signed with an API secret key, the request made to it needs to look exactly as expected. |
@dylanscott - Thanks for the interceptor tip, even though not pretty gets it working. If it helps someone, here's the code. |
this PR #372 has solved this problem,Please migrate to version 0.18.0 or 0.19.0. |
#### Summary
I've noticed a change in the behavior of body-less POST requests sent from axios between v0.16.1 and v0.17.1. This change is breaking and as far as I can tell it is not documented.
Here is some code that exercises this:
I've ran this request through a proxy that records the request details. For v0.16.1 I get:
For v0.17.1:
Note that now a default Content-Type header is being specified, even though there is no request body. This breaks in particular on this Dropbox API endpoint I'm hitting because it requires you not to specify a Content-Type header. The only way I've figured out how to not send this header is to add a request interceptor that deletes it, which is pretty annoying.
#### Context
The text was updated successfully, but these errors were encountered: