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