From 79c4c9536cd16c437f6b04031b64e57d08beb404 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=84=86=E8=96=AF=E9=A5=BC?= Date: Tue, 24 Dec 2024 19:15:36 +0800 Subject: [PATCH] fix: fetch Update fetch.mjs --- polyfill/fetch.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/polyfill/fetch.mjs b/polyfill/fetch.mjs index 45f5046..57fa70f 100644 --- a/polyfill/fetch.mjs +++ b/polyfill/fetch.mjs @@ -185,7 +185,7 @@ export async function fetch(resource, options = {}) { status: response.status, statusCode: response.status, statusText: response.statusText, - body: bodyBytes.toString("utf-8"), + body: new TextDecoder("utf-8").decode(bodyBytes), bodyBytes: bodyBytes, headers: Object.fromEntries(Object.entries(headers).map(([key, value]) => [key, key.toLowerCase() !== "set-cookie" ? value.toString() : value])), };