From 5d36692635365b2015f4746b16c94d7306718dff Mon Sep 17 00:00:00 2001 From: Rizky Date: Fri, 21 Jun 2024 13:14:30 +0700 Subject: [PATCH] fix --- pkgs/core/api/_proxy.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/core/api/_proxy.ts b/pkgs/core/api/_proxy.ts index b5c63034..1400d7d6 100644 --- a/pkgs/core/api/_proxy.ts +++ b/pkgs/core/api/_proxy.ts @@ -36,6 +36,7 @@ export const _ = { res_headers[k] = v; }); res_body = await res.arrayBuffer(); + if (res_headers["content-encoding"] === "gzip") { res_body = await gzipAsync(new Uint8Array(res_body)); delete res_headers["content-encoding"]; @@ -46,8 +47,7 @@ export const _ = { res_body = await brotli.decompress(res_body); delete res_headers["content-encoding"]; } - - console.log(url, res_headers); + console.log(url.toString(), new TextDecoder().decode(res_body)); return new Response(res_body, { headers: res_headers }); } catch (e: any) {