Skip to content

Commit fd632f5

Browse files
reime005lnikkila
authored andcommitted
set blob as default XMLHttpRequest header response type if supported (facebook#22063)
Summary: This is a problem that is discussed in issue facebook#21092 Related issues: facebook#21851 facebook#19717 Found the code to eventually fix this issue [here](https://github.com/github/fetch/blob/899b155746630c32d83ee29a38642da16b314ecb/fetch.js#L486) - [x] Fetching an image locally and check if the blob is there, as well as its size > 0. ___ Help reviewers and the release process by writing your own release notes. See below for an example. [GENERAL] [ENHANCEMENT] [whatwg-fetch] - set blob as default XMLHttpRequest header response type if supported Pull Request resolved: facebook#22063 Differential Revision: D13408797 Pulled By: cpojer fbshipit-source-id: 9822d5a7e24bacd72838f3fc9a61b1a97b44484b
1 parent 043ceed commit fd632f5

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

Libraries/vendor/core/whatwg-fetch.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -516,6 +516,10 @@
516516
xhr.withCredentials = false;
517517
}
518518

519+
if ('responseType' in xhr && support.blob) {
520+
xhr.responseType = 'blob'
521+
}
522+
519523
request.headers.forEach(function(value, name) {
520524
xhr.setRequestHeader(name, value);
521525
});

0 commit comments

Comments
 (0)