Skip to content

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

Closed
@gpichot

Description

@gpichot

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.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingopenapi-fetchRelevant to the openapi-fetch library

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions