mirror of
https://github.com/mozilla/pdf.js.git
synced 2026-06-27 10:35:48 +02:00
Use Response.prototype.bytes() more in the code-base (PR 20651 follow-up)
This commit is contained in:
parent
aaf9b3bad0
commit
0c514b008b
@ -29,7 +29,7 @@ const response = await fetch(JPEG_IMAGE);
|
|||||||
if (!response.ok) {
|
if (!response.ok) {
|
||||||
throw new Error(response.statusText);
|
throw new Error(response.statusText);
|
||||||
}
|
}
|
||||||
const typedArrayImage = new Uint8Array(await response.arrayBuffer());
|
const typedArrayImage = await response.bytes();
|
||||||
|
|
||||||
// Parse the image data using `JpegImage`.
|
// Parse the image data using `JpegImage`.
|
||||||
//
|
//
|
||||||
|
|||||||
@ -85,8 +85,7 @@ async function writeStream(stream, buffer, transform) {
|
|||||||
.catch(() => {});
|
.catch(() => {});
|
||||||
|
|
||||||
// Response::text doesn't return the correct data.
|
// Response::text doesn't return the correct data.
|
||||||
const buf = await new Response(cs.readable).arrayBuffer();
|
bytes = await new Response(cs.readable).bytes();
|
||||||
bytes = new Uint8Array(buf);
|
|
||||||
|
|
||||||
let newFilter, newParams;
|
let newFilter, newParams;
|
||||||
if (!filter) {
|
if (!filter) {
|
||||||
|
|||||||
@ -746,9 +746,7 @@ class SignatureExtractor {
|
|||||||
|
|
||||||
writer.close();
|
writer.close();
|
||||||
|
|
||||||
const buf = await new Response(cs.readable).arrayBuffer();
|
const bytes = await new Response(cs.readable).bytes();
|
||||||
const bytes = new Uint8Array(buf);
|
|
||||||
|
|
||||||
return bytes.toBase64();
|
return bytes.toBase64();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user