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 of type multipart must include a boundary parameter #1956

Open
gpichot opened this issue Oct 22, 2024 · 0 comments
Open

Content-Type of type multipart must include a boundary parameter #1956

gpichot opened this issue Oct 22, 2024 · 0 comments
Assignees
Labels
bug Something isn't working openapi-fetch Relevant to the openapi-fetch library

Comments

@gpichot
Copy link

gpichot commented Oct 22, 2024

Description

Hello,
First, thanks a lot for this great library, it's very useful in one of the projects I am working on.
I spent some to find the reason of the bug below so I thought to put it here for reference. Feel free to close the issue.
=> PR #1826 was a breaking change on our side as we migrated from 0.8.x to 0.12.x

POST requests with FormData were failing with Content-Type of type multipart must include a boundary parameter.

Reason is:

We had some code that was setting headers.set('Content-Type', 'multipart/form-data') (no idea why 🤔).
This header was removed in openapi-fetch prior to the PR. So the browser was setting the correct Content-Type.

After this PR, the header is now left in headers and therefore the browser does not set the correct Content-Type.
Hence the issue.
We fixed it by removing the line above.

Best! And again feel free to close this issue.

@gpichot gpichot added bug Something isn't working openapi-fetch Relevant to the openapi-fetch library labels Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working openapi-fetch Relevant to the openapi-fetch library
Projects
Status: No status
Development

No branches or pull requests

2 participants