Skip to content

Commit

Permalink
fix: keep FormData as is
Browse files Browse the repository at this point in the history
  • Loading branch information
posva committed Oct 3, 2023
1 parent 9272afb commit 3b106f4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/mande.ts
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,8 @@ export function mande(
// only stringify body if it's a POST/PUT/PATCH, otherwise it could be the options object
// it's not used by GET/DELETE but it would also be wasteful
if (method[0] === 'P' && data && !mergedOptions.body) {
mergedOptions.body = data instanceof FormData ? data : mergedOptions.stringify(data)
mergedOptions.body =
data instanceof FormData ? data : mergedOptions.stringify(data)
}

// we check the localFetch here to account for global fetch polyfills and msw in tests
Expand Down

0 comments on commit 3b106f4

Please sign in to comment.