Skip to content
This repository has been archived by the owner on Dec 15, 2021. It is now read-only.

Commit

Permalink
Fixing overwrite Blob/File type as Content-Type in browser. (axios#1773)
Browse files Browse the repository at this point in the history
Co-authored-by: Jay <[email protected]>
  • Loading branch information
2 people authored and gwdp committed Jul 17, 2020
1 parent 24b6c06 commit 78112ae
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/adapters/xhr.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,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 78112ae

Please sign in to comment.