Describe the bug
After upgrading msw from 1.x to 2.x FormData upload stopped working in tests. Looking at the debugging output, Axios doesn't append the boundary to the Content-Type header anymore.
The MSW team checked [1] this already on their side.
I tried to append the boundary manually to the header for debugging purposes, but that revealed another issue:
{ "Content-Type": "multipart/form-data; boundary=abc" }
ends in
Content-Type: multipart/form-databoundary=abc
[1] mswjs/msw#1835
To Reproduce
Checkout the msw reproducer at [1] and
cd examples/with-vitest
npm install
npm test
[1] https://github.com/pschyma/msw-examples/tree/axios-formdata-reproducer
Code snippet
No response
Expected behavior
As with msw the boundary is appended to Content-Type header.
Axios Version
1.6.0
Adapter Version
XHR
Browser
jsdom
Browser Version
No response
Node.js Version
18.8.2
OS
Linux
Additional Library Versions
Additional context/Screenshots
No response
Describe the bug
After upgrading msw from 1.x to 2.x
FormDataupload stopped working in tests. Looking at the debugging output, Axios doesn't append theboundaryto theContent-Typeheader anymore.The MSW team checked [1] this already on their side.
I tried to append the boundary manually to the header for debugging purposes, but that revealed another issue:
ends in
[1] mswjs/msw#1835
To Reproduce
Checkout the msw reproducer at [1] and
[1] https://github.com/pschyma/msw-examples/tree/axios-formdata-reproducer
Code snippet
No response
Expected behavior
As with msw the
boundaryis appended toContent-Typeheader.Axios Version
1.6.0
Adapter Version
XHR
Browser
jsdom
Browser Version
No response
Node.js Version
18.8.2
OS
Linux
Additional Library Versions
Additional context/Screenshots
No response