修复移动云盘检测500

This commit is contained in:
mtvpls
2026-05-07 16:26:45 +08:00
rodzic 949f8a712f
commit 46dfbdb13c
2 zmienionych plików z 4 dodań i 3 usunięć
+1 -1
Wyświetl plik
@@ -72,7 +72,7 @@ export async function checkCMCC(link) {
);
if (statusCode !== 200) {
return { valid: false, reason: `API返回错误状态码: ${statusCode}` };
return { valid: false, reason: `API返回错误状态码: ${statusCode}, 响应: ${body}` };
}
const response = JSON.parse(aesCBCDecrypt(body.trim(), CMCC_AES_KEY));
+3 -2
Wyświetl plik
@@ -19,7 +19,6 @@ export function request(url, options = {}) {
const transport = parsedUrl.protocol === 'https:' ? https : http;
const headers = { ...DEFAULT_HEADERS, ...(options.headers || {}) };
delete headers['Content-Type'];
const reqOptions = {
hostname: parsedUrl.hostname,
@@ -47,7 +46,9 @@ export function request(url, options = {}) {
if (options.body) {
if (typeof options.body === 'object') {
req.setHeader('Content-Type', 'application/json');
if (!req.hasHeader('Content-Type')) {
req.setHeader('Content-Type', 'application/json');
}
req.write(JSON.stringify(options.body));
} else {
req.write(options.body);