From 5d593a9d791b996447ddcd71030eb557b7e41f32 Mon Sep 17 00:00:00 2001 From: guibwl <228474838@qq.com> Date: Thu, 14 Dec 2023 13:32:43 +0800 Subject: [PATCH] feat 307 308 supported --- sources/httpUtils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/httpUtils.ts b/sources/httpUtils.ts index 384ccd849..8bc0dee8d 100644 --- a/sources/httpUtils.ts +++ b/sources/httpUtils.ts @@ -16,7 +16,7 @@ export async function fetchUrlStream(url: string, options: RequestOptions = {}) const creatRequest = (url: string) => https.get(url, {...options, agent: proxyAgent}, response => { const statusCode = response.statusCode; - if (statusCode === 301 || statusCode === 302) + if ([301, 302, 307, 308].includes(statusCode)) return creatRequest(response.headers.location); if (statusCode != null && statusCode >= 200 && statusCode < 300)