set blob as default XMLHttpRequest header response type if supported (#22063)
Summary:
This is a problem that is discussed in issue #21092
Related issues: #21851 #19717
Found the code to eventually fix this issue [here](899b155746/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: https://github.com/facebook/react-native/pull/22063
Differential Revision: D13408797
Pulled By: cpojer
fbshipit-source-id: 9822d5a7e24bacd72838f3fc9a61b1a97b44484b
This commit is contained in:
parent
6cc6f8f488
commit
ddc3471f88
|
@ -516,6 +516,10 @@
|
||||||
xhr.withCredentials = false;
|
xhr.withCredentials = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ('responseType' in xhr && support.blob) {
|
||||||
|
xhr.responseType = 'blob'
|
||||||
|
}
|
||||||
|
|
||||||
request.headers.forEach(function(value, name) {
|
request.headers.forEach(function(value, name) {
|
||||||
xhr.setRequestHeader(name, value);
|
xhr.setRequestHeader(name, value);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue