Skip to content

Commit

Permalink
fix(http): set formdata boundary and body when content-type not expli…
Browse files Browse the repository at this point in the history
…citly set (#7133)

Co-authored-by: Chace Daniels <[email protected]>
Co-authored-by: Dan Giralté <[email protected]>
  • Loading branch information
3 people authored Dec 14, 2023
1 parent 5fb902b commit 3862d6e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion core/src/core-plugins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,10 @@ export const buildRequestInit = (
params.set(key, value as any);
}
output.body = params.toString();
} else if (type.includes('multipart/form-data')) {
} else if (
type.includes('multipart/form-data') ||
options.data instanceof FormData
) {
const form = new FormData();
if (options.data instanceof FormData) {
options.data.forEach((value, key) => {
Expand Down

0 comments on commit 3862d6e

Please sign in to comment.