Skip to content

Commit

Permalink
Fixing overwrite Blob/File type as Content-Type in browser.
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerhut committed Jun 24, 2019
1 parent 2ee3b48 commit 1b33e70
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/adapters/xhr.js
Expand Up @@ -16,6 +16,13 @@ module.exports = function xhrAdapter(config) {
delete requestHeaders['Content-Type']; // Let the browser set it
}

if (
(utils.isBlob(requestData) || utils.isFile(requestData)) &&
requestData.type
) {
delete requestHeaders['Content-Type']; // Let the browser set it
}

var request = new XMLHttpRequest();

// HTTP basic authentication
Expand Down

0 comments on commit 1b33e70

Please sign in to comment.