From c8f999cda746285d318cc1682b7d13680d10cb36 Mon Sep 17 00:00:00 2001 From: SukkaW Date: Thu, 5 Sep 2024 01:31:00 +0800 Subject: [PATCH] Workaround GitLab hot-link protection --- Build/download-previous-build.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Build/download-previous-build.ts b/Build/download-previous-build.ts index d4397c8e..f414dabd 100644 --- a/Build/download-previous-build.ts +++ b/Build/download-previous-build.ts @@ -72,8 +72,14 @@ export const downloadPreviousBuild = task(require.main === module, __filename)(a const resp = await fetchWithRetry(tarGzUrl, { headers: { 'User-Agent': 'curl/8.9.1', - Accept: 'application/octet-stream' + // https://github.com/unjs/giget/issues/97 + // https://gitlab.com/gitlab-org/gitlab/-/commit/50c11f278d18fe1f3fb12eb595067216bb58ade2 + 'sec-fetch-mode': 'same-origin' }, + // https://github.com/unjs/giget/issues/97 + // https://gitlab.com/gitlab-org/gitlab/-/commit/50c11f278d18fe1f3fb12eb595067216bb58ade2 + + mode: 'same-origin', retry: { retryOnNon2xx: false }