aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2021-01-16 19:23:02 +0800
committerGitHub <noreply@github.com>2021-01-16 12:23:02 +0100
commitdc66e4740f1d788e67f758ee3a6bbeb646ad704a (patch)
tree9cb482bbe6d92146f5a12a2c69ad7b4d97ce3094
parent76fefd803fde5899022777dc9aef8bdc09472107 (diff)
downloadgitea-dc66e4740f1d788e67f758ee3a6bbeb646ad704a.tar.gz
gitea-dc66e4740f1d788e67f758ee3a6bbeb646ad704a.zip
Fix middlewares sequences (#14354)
Co-authored-by: 6543 <6543@obermui.de>
-rw-r--r--routers/api/v1/api.go10
1 files 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() {