From dc66e4740f1d788e67f758ee3a6bbeb646ad704a Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Sat, 16 Jan 2021 19:23:02 +0800 Subject: [PATCH] Fix middlewares sequences (#14354) Co-authored-by: 6543 <6543@obermui.de> --- routers/api/v1/api.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/routers/api/v1/api.go b/routers/api/v1/api.go index e9f1a395ed..02ad8ab360 100644 --- a/routers/api/v1/api.go +++ b/routers/api/v1/api.go @@ -640,7 +640,7 @@ func RegisterRoutes(m *macaron.Macaron) { m.Group("/:username/:reponame", func() { m.Combo("").Get(reqAnyRepoReader(), repo.Get). Delete(reqToken(), reqOwner(), repo.Delete). - Patch(reqToken(), reqAdmin(), bind(api.EditRepoOption{}), context.RepoRefForAPI(), repo.Edit) + Patch(reqToken(), reqAdmin(), context.RepoRefForAPI(), bind(api.EditRepoOption{}), repo.Edit) m.Post("/transfer", reqOwner(), bind(api.TransferRepoOption{}), repo.Transfer) m.Combo("/notifications"). Get(reqToken(), notify.ListRepoNotifications). @@ -713,8 +713,8 @@ func RegisterRoutes(m *macaron.Macaron) { Delete(reqToken(), repo.DeleteIssueComment) m.Combo("/reactions"). Get(repo.GetIssueCommentReactions). - Post(bind(api.EditReactionOption{}), reqToken(), repo.PostIssueCommentReaction). - Delete(bind(api.EditReactionOption{}), reqToken(), repo.DeleteIssueCommentReaction) + Post(reqToken(), bind(api.EditReactionOption{}), repo.PostIssueCommentReaction). + Delete(reqToken(), bind(api.EditReactionOption{}), repo.DeleteIssueCommentReaction) }) }) m.Group("/:index", func() { @@ -754,8 +754,8 @@ func RegisterRoutes(m *macaron.Macaron) { }) m.Combo("/reactions"). Get(repo.GetIssueReactions). - Post(bind(api.EditReactionOption{}), reqToken(), repo.PostIssueReaction). - Delete(bind(api.EditReactionOption{}), reqToken(), repo.DeleteIssueReaction) + Post(reqToken(), bind(api.EditReactionOption{}), repo.PostIssueReaction). + Delete(reqToken(), bind(api.EditReactionOption{}), repo.DeleteIssueReaction) }) }, mustEnableIssuesOrPulls) m.Group("/labels", func() {