mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-08-20 09:21:11 +00:00
fix: migrate new Github release assets (#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 Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8771 Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org> Co-authored-by: Gusted <postmaster@gusted.xyz> Co-committed-by: Gusted <postmaster@gusted.xyz>
This commit is contained in:
parent
7566ebfba7
commit
e50cfc8499
1 changed files with 2 additions and 1 deletions
|
@ -364,7 +364,8 @@ func (g *GithubDownloaderV3) convertGithubRelease(rel *github.RepositoryRelease)
|
||||||
|
|
||||||
// Prevent open redirect
|
// Prevent open redirect
|
||||||
if !hasBaseURL(redirectURL, g.baseURL) &&
|
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)
|
WarnAndNotice("Unexpected AssetURL for assetID[%d] in %s: %s", asset.GetID(), g, redirectURL)
|
||||||
|
|
||||||
return io.NopCloser(strings.NewReader(redirectURL)), nil
|
return io.NopCloser(strings.NewReader(redirectURL)), nil
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue