mirror of
https://github.com/go-gitea/gitea.git
synced 2026-08-22 19:33:33 +00:00
Backport #39006 by @bircni Enforce public-only token scope for repositories resolved as compare heads. _Assisted-by: Codex:GPT-5_ Co-authored-by: bircni <bircni@icloud.com>
This commit is contained in:
@@ -1099,6 +1099,10 @@ func parseCompareInfo(ctx *context.APIContext, compareParam string) (result *git
|
||||
ctx.APIErrorInternal(err)
|
||||
return nil, nil
|
||||
}
|
||||
if !ctx.TokenCanAccessRepo(headRepo) {
|
||||
ctx.APIErrorNotFound()
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
isSameRepo := baseRepo.ID == headRepo.ID
|
||||
|
||||
|
||||
Reference in New Issue
Block a user