decompress brotli
This commit is contained in:
parent
14120c8465
commit
244bd86691
|
|
@ -24,7 +24,7 @@ export const _ = {
|
||||||
headers[k] = v;
|
headers[k] = v;
|
||||||
});
|
});
|
||||||
|
|
||||||
const res = await fetch(url, {
|
const res = await fetch(url as any, {
|
||||||
method: req.method || "POST",
|
method: req.method || "POST",
|
||||||
headers,
|
headers,
|
||||||
body,
|
body,
|
||||||
|
|
@ -38,6 +38,8 @@ export const _ = {
|
||||||
res_body = await res.arrayBuffer();
|
res_body = await res.arrayBuffer();
|
||||||
if (res_headers["content-encoding"] === "gzip") {
|
if (res_headers["content-encoding"] === "gzip") {
|
||||||
res_body = await gzipAsync(new Uint8Array(res_body));
|
res_body = await gzipAsync(new Uint8Array(res_body));
|
||||||
|
} if (res_headers["content-encoding"] === "br") {
|
||||||
|
res_body = brotli.decompress(new Uint8Array(res_body));
|
||||||
} else {
|
} else {
|
||||||
delete res_headers["content-encoding"];
|
delete res_headers["content-encoding"];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue