Re: [whatwg/fetch] Use a ReadableStream with byte source (formerly called ReadableByteStream) for .body (#267)

Currently the fetch spec allows constructing a Response with any ReadableStream, which can thus be enqueued with ArrayBuffers, Uint8Arrays or potatoes.

Restricting the Response body to a ReadableStream with a byte source would remove the possibility to enqueue potatoes, leaving space for ArrayBuffer and ArrayBufferView.

But enqueuing something else than Uint8Array would still lead to TypeError when consuming the body, since "read all bytes" requires Uint8Array objects.
Can we remove that restriction?
That would make it consistent with the possibility to create a Response with whatever ArrayBuffer/ArrayBufferView.



-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/fetch/issues/267#issuecomment-242391574

Received on Thursday, 25 August 2016 13:46:13 UTC