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