mirror of
https://github.com/go-gitea/gitea
synced 2025-08-14 05:28:27 +00:00
backport #28213 This PR will fix some missed checks for private repositories' data on web routes and API routes.
This commit is contained in:
@@ -155,6 +155,12 @@ func GetDeployKey(ctx *context.APIContext) {
|
||||
return
|
||||
}
|
||||
|
||||
// this check make it more consistent
|
||||
if key.RepoID != ctx.Repo.Repository.ID {
|
||||
ctx.NotFound()
|
||||
return
|
||||
}
|
||||
|
||||
if err = key.GetContent(); err != nil {
|
||||
ctx.Error(http.StatusInternalServerError, "GetContent", err)
|
||||
return
|
||||
|
Reference in New Issue
Block a user