浏览代码

Workaround GitLab hot-link protection

SukkaW 1 年之前
父节点
当前提交
c8f999cda7
共有 1 个文件被更改,包括 7 次插入1 次删除
  1. 7 1
      Build/download-previous-build.ts

+ 7 - 1
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
       }