mirror of
https://github.com/denoland/deno.git
synced 2025-03-03 09:31:22 -05:00
fix(ext/fetch): throw TypeError on non-Uint8Array chunk (#16262)
This commit is contained in:
parent
50c7b89369
commit
0d6dbc08be
2 changed files with 8 additions and 0 deletions
|
@ -813,6 +813,12 @@
|
|||
const { value: chunk, done } = await reader.read();
|
||||
if (done) break;
|
||||
|
||||
if (!ObjectPrototypeIsPrototypeOf(Uint8ArrayPrototype, chunk)) {
|
||||
throw new TypeError(
|
||||
"Can't convert value to Uint8Array while consuming the stream",
|
||||
);
|
||||
}
|
||||
|
||||
ArrayPrototypePush(chunks, chunk);
|
||||
totalLength += chunk.byteLength;
|
||||
}
|
||||
|
|
|
@ -3003,6 +3003,8 @@
|
|||
"response-static-error.any.worker.html": true,
|
||||
"response-static-redirect.any.html": true,
|
||||
"response-static-redirect.any.worker.html": true,
|
||||
"response-stream-bad-chunk.any.html": true,
|
||||
"response-stream-bad-chunk.any.worker.html": true,
|
||||
"response-stream-disturbed-1.any.html": true,
|
||||
"response-stream-disturbed-1.any.worker.html": true,
|
||||
"response-stream-disturbed-2.any.html": true,
|
||||
|
|
Loading…
Add table
Reference in a new issue