mirror of
https://github.com/tenrok/axios.git
synced 2026-06-20 20:00:40 +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)) {
|
if (utils.isFormData(requestData)) {
|
||||||
requestHeaders.setContentType(false); // Let the browser set it
|
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();
|
let request = new XMLHttpRequest();
|
||||||
|
|||||||
Reference in New Issue
Block a user