Skip to content

Commit

Permalink
add blob support to passthrough
Browse files Browse the repository at this point in the history
  • Loading branch information
Jordan Vincent committed Sep 13, 2016
1 parent 1d451d8 commit 3acedb2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pretender.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ function interceptor(pretender) {

var xhr = fakeXHR._passthroughRequest = new pretender._nativeXMLHttpRequest();

if (fakeXHR.responseType === 'arraybuffer') {
if (fakeXHR.responseType === 'arraybuffer' || fakeXHR.responseType === 'blob') {
lifecycleProps = ['readyState', 'response', 'status', 'statusText'];
xhr.responseType = fakeXHR.responseType;
}
Expand All @@ -157,7 +157,7 @@ function interceptor(pretender) {
}

// add progress event for async calls
if (fakeXHR.async && fakeXHR.responseType !== 'arraybuffer') {
if (fakeXHR.async && fakeXHR.responseType !== 'arraybuffer' && fakeXHR.responseType !== 'blob') {
evts.push('progress');
}

Expand Down

0 comments on commit 3acedb2

Please sign in to comment.