diff --git a/routers/api/v1/repo/key.go b/routers/api/v1/repo/key.go index 7d97f5f5e2..921f04b703 100644 --- a/routers/api/v1/repo/key.go +++ b/routers/api/v1/repo/key.go @@ -159,6 +159,11 @@ func GetDeployKey(ctx *context.APIContext) { return } + if key.RepoID != ctx.Repo.Repository.ID { + ctx.Status(http.StatusNotFound) + return + } + if err = key.GetContent(); err != nil { ctx.Error(http.StatusInternalServerError, "GetContent", err) return