From 7cb782ae27954734a94869a1c359174326ebe059 Mon Sep 17 00:00:00 2001 From: Andy Hsu Date: Sat, 12 Aug 2023 15:15:09 +0800 Subject: [PATCH] follow redirect for download request --- .github/workflows/build.yml | 2 +- src/handleDownload.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b656cf6..9b6eba8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -50,7 +50,7 @@ jobs: cp -r ../cf-workers-proxy/dist/index.js ./alist-proxy.js git add . git config --local user.email "i@nn.ci" - git config --local user.name "Noah Hsu" + git config --local user.name "Andy Hsu" git commit --allow-empty -m "auto update alist-proxy.js" -a cd .. - name: Upload dist files diff --git a/src/handleDownload.ts b/src/handleDownload.ts index c86e1aa..1ef9bc9 100644 --- a/src/handleDownload.ts +++ b/src/handleDownload.ts @@ -37,7 +37,7 @@ export async function handleDownload(request: Request) { if (res.code !== 200) { return new Response(JSON.stringify(res)); } - request = new Request(res.data.url, request); + request = new Request(res.data.url, { ...request, redirect: "follow" }); if (res.data.header) { for (const k in res.data.header) { for (const v of res.data.header[k]) {