Skip to content

make Response and Headers serializable #1399

Open
@arenevier

Description

@arenevier

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions