[whatwg/fetch] Resizable ArrayBuffers and Response and Request objects (Issue #1560)

@domenic @annevk ... Wondering what the expected behavior should be here with the upcoming introduction of resizable ArrayBuffers.

Assuming something like the following:

```
const enc = new TextEncoder();
const ab = new ArrayBuffer(10, { maxByteLength: 20 })
const u8 = new Uint8Array(ab, 0, 10);
const resp = new Response(u8);

// Edit u8 after calling new Response...
enc.encodeInto('hellothere', u8);

// Resize after calling new Response...
ab.resize(8);
```

What *should* be expect the `Content-Length` and payload content to be?

* Option 1: Content-Length == 10, payload `\0000\0000\0000\0000\0000\0000\0000\0000\0000\0000`
* Option 2: Content-Length == 10, payload `hellothe\0000\0000`
* Option 3: Content-Length == 8, payload `hellothe`
* Option 4: Something else?

Should the `u8`/`ab` become detached when passed to `new Response(...)`?

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

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

Received on Monday, 5 December 2022 22:37:44 UTC