aboutsummaryrefslogtreecommitdiffstats
path: root/routers/api/v1/repo/key.go
diff options
context:
space:
mode:
Diffstat (limited to 'routers/api/v1/repo/key.go')
-rw-r--r--routers/api/v1/repo/key.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/routers/api/v1/repo/key.go b/routers/api/v1/repo/key.go
index 824880880a..7b2151f2f8 100644
--- a/routers/api/v1/repo/key.go
+++ b/routers/api/v1/repo/key.go
@@ -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