Skip to content

Commit 3acedb2

Browse files
author
Jordan Vincent
authored
add blob support to passthrough
See pretenderjs#157
1 parent 1d451d8 commit 3acedb2

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

pretender.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ function interceptor(pretender) {
146146

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

149-
if (fakeXHR.responseType === 'arraybuffer') {
149+
if (fakeXHR.responseType === 'arraybuffer' || fakeXHR.responseType === 'blob') {
150150
lifecycleProps = ['readyState', 'response', 'status', 'statusText'];
151151
xhr.responseType = fakeXHR.responseType;
152152
}
@@ -157,7 +157,7 @@ function interceptor(pretender) {
157157
}
158158

159159
// add progress event for async calls
160-
if (fakeXHR.async && fakeXHR.responseType !== 'arraybuffer') {
160+
if (fakeXHR.async && fakeXHR.responseType !== 'arraybuffer' && fakeXHR.responseType !== 'blob') {
161161
evts.push('progress');
162162
}
163163

0 commit comments

Comments
 (0)