mirror of
https://github.com/tenrok/axios.git
synced 2026-05-27 14:47:43 +03:00
fix(formdata): add multipart/form-data content type for FormData payload on custom client environments; (#5678)
This commit is contained in:
+6
-2
@@ -61,8 +61,12 @@ export default isXHRAdapterSupported && function (config) {
|
||||
}
|
||||
}
|
||||
|
||||
if (utils.isFormData(requestData) && (platform.isStandardBrowserEnv || platform.isStandardBrowserWebWorkerEnv)) {
|
||||
requestHeaders.setContentType(false); // Let the browser set it
|
||||
if (utils.isFormData(requestData)) {
|
||||
if (platform.isStandardBrowserEnv || platform.isStandardBrowserWebWorkerEnv) {
|
||||
requestHeaders.setContentType(false); // Let the browser set it
|
||||
} else {
|
||||
requestHeaders.setContentType('multipart/form-data;', false); // mobile/desktop app frameworks
|
||||
}
|
||||
}
|
||||
|
||||
let request = new XMLHttpRequest();
|
||||
|
||||
Reference in New Issue
Block a user