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 <jasonsaayman@gmail.com>
  • Loading branch information
2 people authored and gwdp committed Jul 17, 2020
1 parent 1db4621 commit 7b2775a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/adapters/xhr.js
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 7b2775a

Please sign in to comment.