From 5322136af8bef35d61303b9fdd2c10753d4bb54b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Dachary?= Date: Sun, 12 Nov 2023 22:45:59 +0100 Subject: [PATCH] fix GET /api/v1/repos/{owner}/{repo}/keys/{id} (cherry picked from commit 768238d9f9982e99ad4cbf3942d2d2db5126a150) Conflicts: routers/api/v1/repo/key.go trivial context conflict --- routers/api/v1/repo/key.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/routers/api/v1/repo/key.go b/routers/api/v1/repo/key.go index 824880880a..4d25df9108 100644 --- a/routers/api/v1/repo/key.go +++ b/routers/api/v1/repo/key.go @@ -155,6 +155,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