This commit is contained in:
jonathang4 2025-08-27 18:00:53 +08:00
parent 6fae98f89b
commit b519eb907d

View File

@ -171,7 +171,10 @@ export async function request(
},
timeout: 15000,
validateStatus: () => true,
..._.omit(options, "params", "headers"),
..._.omit(options, "params", "headers", "maxContentLength", "maxBodyLength"),
// 强制设置为Infinity解决-1错误放在最后确保不被覆盖
maxContentLength: Infinity,
maxBodyLength: Infinity,
});
// 流式响应直接返回response
if (options.responseType == "stream") return response;
@ -187,6 +190,8 @@ export async function checkFileUrl(fileUrl: string) {
if (util.isBASE64Data(fileUrl)) return;
const result = await axios.head(fileUrl, {
timeout: 15000,
maxContentLength: Infinity,
maxBodyLength: Infinity,
validateStatus: () => true,
});
if (result.status >= 400)