[whatwg/fetch] make Response and Headers serializable (Issue #1399)

Hi,

It's possible to clone a Response with Response.clone(), but structuredClone does not accept Response.

If structuredClone accepted a Response, it could be passed via postMessage. And if the response.body is in the transferList, it would be transferred instead of being tee-ed.

The same would also be useful to Headers only: if we want to pass headers informations between workers, we have to pass around the key/values, and reconstruct it with the data being passed (and we loose the guard information). Since the browsers are already able to clone the headers as part of Response.clone(), maybe it could be exposed to userland.

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

Message ID: <whatwg/fetch/issues/1399@github.com>

Received on Friday, 4 February 2022 22:08:18 UTC