修复移动云盘检测500

This commit is contained in:
mtvpls
2026-05-07 16:26:45 +08:00
parent 949f8a712f
commit 46dfbdb13c
2 changed files with 4 additions and 3 deletions
+1 -1
View File
@@ -72,7 +72,7 @@ export async function checkCMCC(link) {
); );
if (statusCode !== 200) { 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)); const response = JSON.parse(aesCBCDecrypt(body.trim(), CMCC_AES_KEY));
+3 -2
View File
@@ -19,7 +19,6 @@ export function request(url, options = {}) {
const transport = parsedUrl.protocol === 'https:' ? https : http; const transport = parsedUrl.protocol === 'https:' ? https : http;
const headers = { ...DEFAULT_HEADERS, ...(options.headers || {}) }; const headers = { ...DEFAULT_HEADERS, ...(options.headers || {}) };
delete headers['Content-Type'];
const reqOptions = { const reqOptions = {
hostname: parsedUrl.hostname, hostname: parsedUrl.hostname,
@@ -47,7 +46,9 @@ export function request(url, options = {}) {
if (options.body) { if (options.body) {
if (typeof options.body === 'object') { 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)); req.write(JSON.stringify(options.body));
} else { } else {
req.write(options.body); req.write(options.body);