Re: [whatwg/fetch] Request's total bytes isn't set (#604)

Here's my plan:

* Define convert BodyInit object to bytes routine that returns a tuple of a byte sequence and null or a multipart/form-data boundary. This will synchronous but implementations can optimize.
* Define a size of BodyInit object routine that invokes convert and returns the length. We'll use this to set the Content-Type header in requests. (I kinda wanna use `<a for="BodyInit,byte sequence">length</a>` there, but if that's not a thing we'll just branch.)
* Make extract use convert as well instead of all the "actions".

Add a bunch of notes that encourage implementations to optimize this. All ears to better ideas though.

-- 
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/604#issuecomment-786842380

Received on Friday, 26 February 2021 19:16:37 UTC