Skip to content

preparation for whatwg stream on blob.stream() #1091

Description

@jimmywarting

We want to support the real stream at some point and don't have to care whether or not it's a node stream or a blob stream

node-fetch/src/body.js

Lines 178 to 181 in 6ee9d31

// Body is blob
if (isBlob(body)) {
body = body.stream();
}

I think we need change that to this:

 // Body is blob 
 if (isBlob(body)) { 
- 	body = body.stream(); 
+       body = stream.Readable.from(body.stream());
 } 

I where namely thinking of if we should scale down fetch-blob's Blob.prototype.stream function into returning a partial piece of the whatwg stream (which is the async iterator that yields uint8arrays)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions