#1825·node-fetch

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:

  1. Fetch an API on some endpoint (for example /something), sending a file as form-data (during my testing, the content were irrelevant)
  2. Make the API redirect the client to /something/ using a 308 permanent redirect
  3. 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

grafik (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