Skip to content

Commit

Permalink
Avoid blob conversion for specific requests (#752)
Browse files Browse the repository at this point in the history
Co-authored-by: fdacosta <fabio.costa@disneystreaming.com>
Co-authored-by: Jake Champion <me@jakechampion.name>
  • Loading branch information
3 people committed May 28, 2020
1 parent ff32363 commit eadff53
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions fetch.js
Expand Up @@ -494,8 +494,15 @@ export function fetch(input, init) {
xhr.withCredentials = false
}

if ('responseType' in xhr && support.blob) {
xhr.responseType = 'blob'
if ('responseType' in xhr) {
if (support.blob) {
xhr.responseType = 'blob'
} else if (
support.arrayBuffer &&
request.headers.get('Content-Type').indexOf('application/octet-stream') !== -1
) {
xhr.responseType = 'arraybuffer'
}
}

request.headers.forEach(function(value, name) {
Expand Down

0 comments on commit eadff53

Please sign in to comment.