修复移动云盘检测500
This commit is contained in:
+1
-1
@@ -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
@@ -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);
|
||||||
|
|||||||
Reference in New Issue
Block a user