Open
Description
openapi-fetch version
0.14.0
Description
When performing file uploads using multipart/form-data with openapi-fetch, the Content-Length header is being set to approximately double the actual size of the payload compared to plain fetch. This inflated Content-Length is consistently observed because openapi-fetch internally leverages new Request for constructing its requests, which appears to be the root cause of the incorrect header calculation for FormData bodies.
Reproduction
https://github.com/Cigan12/openapi-fetch-reproduction
Expected result
The Content-Length header for multipart/form-data uploads sent via openapi-fetch should accurately represent the byte size of the request body.
Extra
- I’m willing to open a PR (see CONTRIBUTING.md)