Skip to content

Commit

Permalink
set blob as default XMLHttpRequest header response type if supported (f…
Browse files Browse the repository at this point in the history
…acebook#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
  • Loading branch information
reime005 authored and lnikkila committed Jan 21, 2019
1 parent 043ceed commit fd632f5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Libraries/vendor/core/whatwg-fetch.js
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,10 @@
xhr.withCredentials = false;
}

if ('responseType' in xhr && support.blob) {
xhr.responseType = 'blob'
}

request.headers.forEach(function(value, name) {
xhr.setRequestHeader(name, value);
});
Expand Down

0 comments on commit fd632f5

Please sign in to comment.