@nsnanocat/util 1.8.8 → 1.8.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/polyfill/fetch.mjs +2 -1
package/package.json
CHANGED
package/polyfill/fetch.mjs
CHANGED
|
@@ -116,6 +116,7 @@ export async function fetch(resource, options = {}) {
|
|
|
116
116
|
});
|
|
117
117
|
case "Quantumult X":
|
|
118
118
|
// 转换请求参数
|
|
119
|
+
resource.timeout = resource.timeout * 1000;
|
|
119
120
|
if (resource.policy) _.set(resource, "opts.policy", resource.policy);
|
|
120
121
|
if (typeof resource["auto-redirect"] === "boolean") _.set(resource, "opts.redirection", resource["auto-redirect"]);
|
|
121
122
|
// 转换请求体
|
|
@@ -185,7 +186,7 @@ export async function fetch(resource, options = {}) {
|
|
|
185
186
|
status: response.status,
|
|
186
187
|
statusCode: response.status,
|
|
187
188
|
statusText: response.statusText,
|
|
188
|
-
body:
|
|
189
|
+
body: new TextDecoder("utf-8").decode(bodyBytes),
|
|
189
190
|
bodyBytes: bodyBytes,
|
|
190
191
|
headers: Object.fromEntries(Object.entries(headers).map(([key, value]) => [key, key.toLowerCase() !== "set-cookie" ? value.toString() : value])),
|
|
191
192
|
};
|