From 53b61babd282f914c8ff9ea8b49941774f2a6574 Mon Sep 17 00:00:00 2001 From: chenmozhijin <110812055+chenmozhijin@users.noreply.github.com> Date: Tue, 17 Sep 2024 03:30:49 +0800 Subject: [PATCH] update --- build_helper/utils/repo.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build_helper/utils/repo.py b/build_helper/utils/repo.py index 0e30879b..d0366b55 100644 --- a/build_helper/utils/repo.py +++ b/build_helper/utils/repo.py @@ -45,12 +45,12 @@ def dl_artifact(name: str, path: str) -> str: "X-GitHub-Api-Version": "2022-11-28", "Authorization": f'Bearer {token}', } - response = requests.get(dl_url, allow_redirects=False, headers=headers) + response = requests.get(dl_url, allow_redirects=True, headers=headers) if 300 <= response.status_code < 400: redirect_url = response.headers['Location'] else: raise ValueError(f'无法获取重定向URL: {response.status_code} {response.text}') - + logger.debug(f'Redirected to {redirect_url}, response_headers: {response.headers}, cookies: {response.cookies}, content: {response.content}') dl = dl2(redirect_url, path, headers={"Authorization": f'Bearer {token}'}) wait_dl_tasks([dl]) return dl.get_dest()