Skip to content

Commit 68995f3

Browse files
authored
Merge pull request titel-media#1 from dollarshaveclub/readablestream-fix
ReadableStream Body Fix
1 parent 0394c5d commit 68995f3

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/body.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,12 @@ export default function Body(body, {
177177
name
178178
};
179179

180-
this[INTERNALS].readableStream = createReadableStream(this)
180+
const bodyType = getTypeOfBody(body);
181+
if (bodyType !== 'ReadableStream') {
182+
this[INTERNALS].readableStream = createReadableStream(this);
183+
} else {
184+
this[INTERNALS].readableStream = body;
185+
}
181186
}
182187

183188
Body.prototype = {

0 commit comments

Comments
 (0)