Use Response.prototype.bytes() more in the code-base (PR 20651 follow-up)

This commit is contained in:
Jonas Jenwald 2026-03-07 15:50:36 +01:00
parent aaf9b3bad0
commit 0c514b008b
3 changed files with 3 additions and 6 deletions

View File

@ -29,7 +29,7 @@ const response = await fetch(JPEG_IMAGE);
if (!response.ok) {
throw new Error(response.statusText);
}
const typedArrayImage = new Uint8Array(await response.arrayBuffer());
const typedArrayImage = await response.bytes();
// Parse the image data using `JpegImage`.
//

View File

@ -85,8 +85,7 @@ async function writeStream(stream, buffer, transform) {
.catch(() => {});
// Response::text doesn't return the correct data.
const buf = await new Response(cs.readable).arrayBuffer();
bytes = new Uint8Array(buf);
bytes = await new Response(cs.readable).bytes();
let newFilter, newParams;
if (!filter) {

View File

@ -746,9 +746,7 @@ class SignatureExtractor {
writer.close();
const buf = await new Response(cs.readable).arrayBuffer();
const bytes = new Uint8Array(buf);
const bytes = await new Response(cs.readable).bytes();
return bytes.toBase64();
}