Skip to content

Commit a435c70

Browse files
alexblackieGiteaBot
authored andcommitted
Fix GitHub release assets URL validation (go-gitea#35287)
GitHub changed where the attachments on releases are stored, which means repo migrations with releases now fail because the redirect URLs don't match the base URL validation. We need to update the base URL check to check for the `release-assets` subdomain as well.
1 parent f3e6672 commit a435c70

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

services/migrations/github.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,8 @@ func (g *GithubDownloaderV3) convertGithubRelease(ctx context.Context, rel *gith
354354

355355
// Prevent open redirect
356356
if !hasBaseURL(redirectURL, g.baseURL) &&
357-
!hasBaseURL(redirectURL, "https://objects.githubusercontent.com/") {
357+
!hasBaseURL(redirectURL, "https://objects.githubusercontent.com/") &&
358+
!hasBaseURL(redirectURL, "https://release-assets.githubusercontent.com/") {
358359
WarnAndNotice("Unexpected AssetURL for assetID[%d] in %s: %s", asset.GetID(), g, redirectURL)
359360

360361
return io.NopCloser(strings.NewReader(redirectURL)), nil

0 commit comments

Comments
 (0)