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

Co-authored-by: Dan Giralté <[email protected]>
  • Loading branch information
ItsChaceD and giralte-ionic authored Dec 13, 2023
1 parent a986ee5 commit 0c2ccd9
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 @@ -326,7 +326,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 0c2ccd9

Please sign in to comment.