Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
ronag committed Aug 17, 2021
1 parent 0cd0eee commit 7c9b565
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/fetch/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,11 @@ function toWebReadable (iterable) {
ReadableStream = require('stream/web').ReadableStream
}

if (ReadableStream.from) {
// https://github.com/whatwg/streams/pull/1083
return ReadableStream.from(iterable)
}

const iterator = iterable[Symbol.asyncIterator]()

return new ReadableStream({
Expand All @@ -151,7 +156,7 @@ function toWebReadable (iterable) {
async cancel (reason) {
await iterator.return()
}
})
}, 0)
}

// https://w3c.github.io/webappsec-referrer-policy/#set-requests-referrer-policy-on-redirect
Expand Down

0 comments on commit 7c9b565

Please sign in to comment.