修复QX请求头没有Stringify导致请求超时的问题

This commit is contained in:
Peng-YM
2020-12-09 13:12:55 +08:00
parent 3dddc53ed3
commit 6758f5b6e0
6 changed files with 33 additions and 12 deletions

View File

@@ -3123,7 +3123,10 @@ function HTTP(defaultOptions = {baseURL: ""}) {
let worker;
if (isQX) {
worker = $task.fetch({method, ...options});
if (options.headers) {
options.headers = JSON.stringify(options.headers);
}
worker = $task.fetch({method, url: options.url, headers: options.headers, body: options.body});
} else if (isLoon || isSurge || isNode) {
worker = new Promise((resolve, reject) => {
const request = isNode ? require("request") : $httpClient;