fix: repair packaged release downloads
ForgeFlow quality gate / quality (push) Canceled after 0s

This commit is contained in:
NuklearRabbit
2026-07-30 00:58:34 +02:00
parent 60e8aa8fc2
commit 398f986d95
8 changed files with 48 additions and 13 deletions
+6
View File
@@ -426,6 +426,12 @@ class GiteaService {
if (!downloadUrl) {
throw new Error("Gitea did not provide a release asset download URL.");
}
const configuredBase = new URL(normalizeBaseUrl(this.store.data.gitea.baseUrl));
const publishedUrl = new URL(downloadUrl, configuredBase);
const releasePrefix = `/${encodeURIComponent(owner)}/${encodeURIComponent(repo)}/releases/download/`.toLowerCase();
if (publishedUrl.origin !== configuredBase.origin && publishedUrl.protocol === "http:" && publishedUrl.pathname.toLowerCase().startsWith(releasePrefix)) {
downloadUrl = new URL(`${publishedUrl.pathname}${publishedUrl.search}`, configuredBase).toString();
}
return this.downloadAuthenticated(downloadUrl, options);
}