308 Redirect plus multipart/form-data causes wrong boundary
Author: timon-michel-scopevisioCreated Sep 13, 2024Updated Apr 29, 2026
Labelsbug
Reproduction
Steps to reproduce the behavior:
- Fetch an API on some endpoint (for example
/something), sending a file as form-data (during my testing, the content were irrelevant) - Make the API redirect the client to
/something/using a 308 permanent redirect - Watch the API not being able to fetch the file due to an invalid request
Expected behavior
The Client sends the same request twice. But instead the client sends the same headers (including the boundary definition), but a different boundary in the body.
Screenshots
(don't worry, the JWT does not contain any relevant data)
Your Environment
| software | version |
|---|---|
| node-fetch | n/a (builtin) |
| node | 22.8.0-bookworm (docker) |
| npm | 10.8.2 |
| Operating System | Docker amd64 |
Additional context
Source: node-fetch/node-fetch