aboutsummaryrefslogtreecommitdiffstats
path: root/routers/web/web.go
diff options
context:
space:
mode:
authorwxiaoguang <wxiaoguang@gmail.com>2023-07-20 20:41:28 +0800
committerGitHub <noreply@github.com>2023-07-20 12:41:28 +0000
commitaf22f33a932c7b2a4a27298ca6b1f4a168e85fd3 (patch)
tree1dd3759e04b3d33b2b0af9a05922b6ed3790a65e /routers/web/web.go
parentec227d6682844cc3133eb527e1c877492eeda5d8 (diff)
downloadgitea-af22f33a932c7b2a4a27298ca6b1f4a168e85fd3.tar.gz
gitea-af22f33a932c7b2a4a27298ca6b1f4a168e85fd3.zip
Fix the route for pull-request's authors (#26016)
Close #25906 ![image](https://github.com/go-gitea/gitea/assets/2114189/e689f3e1-9a90-46c0-89f4-2d61394d34d3) Succeeded logs: ``` [I] router: completed GET /root/test/issues/posters?&q=%20&_=1689853025011 for [::1]:59271, 200 OK in 127.7ms @ repo/issue.go:3505(repo.IssuePosters) [I] router: completed GET /root/test/pulls/posters?&q=%20&_=1689853968204 for [::1]:59269, 200 OK in 94.3ms @ repo/issue.go:3509(repo.PullPosters) ```
Diffstat (limited to 'routers/web/web.go')
-rw-r--r--routers/web/web.go7
1 files changed, 3 insertions, 4 deletions
diff --git a/routers/web/web.go b/routers/web/web.go
index 4f5901c0ec..b4c0030ab7 100644
--- a/routers/web/web.go
+++ b/routers/web/web.go
@@ -1151,10 +1151,8 @@ func registerRoutes(m *web.Route) {
m.Group("/{username}/{reponame}", func() {
m.Group("", func() {
- m.Group("/{type:issues|pulls}", func() {
- m.Get("", repo.Issues)
- m.Get("/posters", repo.IssuePosters)
- })
+ m.Get("/issues/posters", repo.IssuePosters) // it can't use {type:issues|pulls} because other routes like "/pulls/{index}" has higher priority
+ m.Get("/{type:issues|pulls}", repo.Issues)
m.Get("/{type:issues|pulls}/{index}", repo.ViewIssue)
m.Group("/{type:issues|pulls}/{index}/content-history", func() {
m.Get("/overview", repo.GetContentHistoryOverview)
@@ -1276,6 +1274,7 @@ func registerRoutes(m *web.Route) {
return cancel
})
+ m.Get("/pulls/posters", repo.PullPosters)
m.Group("/pulls/{index}", func() {
m.Get("", repo.SetWhitespaceBehavior, repo.GetPullDiffStats, repo.ViewIssue)
m.Get(".diff", repo.DownloadPullDiff)