From 14a7e6a5adb063740618834db9eb5e432790420f Mon Sep 17 00:00:00 2001 From: forgejo-backport-action Date: Fri, 15 Aug 2025 11:26:07 +0200 Subject: [PATCH] [v12.0/forgejo] fix: migrate new Github release assets (#8899) **Backport:** https://codeberg.org/forgejo/forgejo/pulls/8771 - It seems that mid-May (according to some system notices in Codeberg) Github started (or converted all) release asssets to be made available under `https://release-assets.githubusercontent.com/`. - Update the migration code to allow this baseURL for Github release assets. - Resolves Codeberg/Community#2061 Co-authored-by: Gusted Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8899 Reviewed-by: Gusted Co-authored-by: forgejo-backport-action Co-committed-by: forgejo-backport-action --- services/migrations/github.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/services/migrations/github.go b/services/migrations/github.go index 9721c86180..317eb568b5 100644 --- a/services/migrations/github.go +++ b/services/migrations/github.go @@ -364,7 +364,8 @@ func (g *GithubDownloaderV3) convertGithubRelease(rel *github.RepositoryRelease) // Prevent open redirect if !hasBaseURL(redirectURL, g.baseURL) && - !hasBaseURL(redirectURL, "https://objects.githubusercontent.com/") { + !hasBaseURL(redirectURL, "https://objects.githubusercontent.com/") && + !hasBaseURL(redirectURL, "https://release-assets.githubusercontent.com/") { WarnAndNotice("Unexpected AssetURL for assetID[%d] in %s: %s", asset.GetID(), g, redirectURL) return io.NopCloser(strings.NewReader(redirectURL)), nil