修复移动云盘检测500
This commit is contained in:
+1
-1
@@ -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));
|
||||
|
||||
+2
-1
@@ -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') {
|
||||
if (!req.hasHeader('Content-Type')) {
|
||||
req.setHeader('Content-Type', 'application/json');
|
||||
}
|
||||
req.write(JSON.stringify(options.body));
|
||||
} else {
|
||||
req.write(options.body);
|
||||
|
||||
Reference in New Issue
Block a user