mirror of
https://github.com/tenrok/axios.git
synced 2026-06-14 18:42:33 +03:00
The content type option is left to the developer (#4550)
* The content type option is left to the developer If the browser recognizes the fault, it can protect the developer Although I don't think Axios itself should interfere with developers' choices This parameter is for compatibility with historical issues * Update xhr.js Co-authored-by: Jay <jasonsaayman@gmail.com>
This commit is contained in:
+4
-2
@@ -28,8 +28,10 @@ module.exports = function xhrAdapter(config) {
|
||||
}
|
||||
}
|
||||
|
||||
if (utils.isFormData(requestData) && utils.isStandardBrowserEnv()) {
|
||||
delete requestHeaders['Content-Type']; // Let the browser set it
|
||||
|
||||
if (utils.isFormData(requestData) && utils.isStandardBrowserEnv() && !config.defineContentType ) {
|
||||
// Let the browser set the content type should it not be set
|
||||
delete requestHeaders['Content-Type'];
|
||||
}
|
||||
|
||||
var request = new XMLHttpRequest();
|
||||
|
||||
Reference in New Issue
Block a user