Re: [streams] Add .bytesRead to ReadableByteStream.*Reader (#367)

Like this?

Switch on BodyInit's type:
- Blob, BufferSource, FormData...: Save the original length as `originalLength`. When passed to `fetch()`, calculate `currentLength` by `originalLength - rbs.offset` and generate `Content-Length` header using `currentLength`.
- RBS obtained from onfetch event w/ original length info: Same as above
- RBS obtained from onfetch event w/o original length info: The final length is unknown. Just use the chunked transfer encoding or send the `Content-Length` header using a user provided value (though it's still under discussion https://lists.w3.org/Archives/Public/public-webapps/2014OctDec/0422.html)
- User authored RBS: Same as above

---
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/streams/issues/367#issuecomment-115105357

Received on Thursday, 25 June 2015 04:46:47 UTC