Skip to content

Commit

Permalink
Merge pull request #193 from arjunkomath/fix/form-data-header
Browse files Browse the repository at this point in the history
Fix form data
  • Loading branch information
arjunkomath committed Dec 15, 2021
2 parents f13e653 + 4c7de3f commit 1df9e4d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,10 @@ async function makeRequest(method, auth, url, qs, data, cb) {
}
}

options.headers["Content-Type"] = form.getHeaders()["content-type"];
options.headers["Content-Type"] =
typeof window === "undefined"
? form.getHeaders()["content-type"] // node
: "multipart/form-data"; // browser
options.data = form;
} else {
options.data = JSON.stringify(data);
Expand Down

0 comments on commit 1df9e4d

Please sign in to comment.