Skip to content

Commit

Permalink
follow redirect for download request
Browse files Browse the repository at this point in the history
  • Loading branch information
xhofe committed Aug 12, 2023
1 parent 36da47c commit 7cb782a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/handleDownload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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]) {
Expand Down

0 comments on commit 7cb782a

Please sign in to comment.