This commit is contained in:
1 parent
60e8aa8fc2
commit
398f986d95
8 files changed
+48
-13
No files matched your search
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user