summaryrefslogtreecommitdiffstats
path: root/routers
diff options
context:
space:
mode:
authorEthan Koenig <ethantkoenig@gmail.com>2017-08-28 23:53:51 -0700
committerLunny Xiao <xiaolunwen@gmail.com>2017-08-29 14:53:51 +0800
commit491f0ebc58854560f72a5360060dac1fee3f1883 (patch)
tree42695e37c03bebbeab345320298043e300121014 /routers
parent15d3872281044cfd7aeaf17dae66f6b89078a55e (diff)
downloadgitea-491f0ebc58854560f72a5360060dac1fee3f1883.tar.gz
gitea-491f0ebc58854560f72a5360060dac1fee3f1883.zip
Fix route handler order (#2409)
* Fix route handler order * Fix more routes
Diffstat (limited to 'routers')
-rw-r--r--routers/routes/routes.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/routers/routes/routes.go b/routers/routes/routes.go
index a542094d0c..a51c809588 100644
--- a/routers/routes/routes.go
+++ b/routers/routes/routes.go
@@ -597,7 +597,7 @@ func RegisterRoutes(m *macaron.Macaron) {
m.Get("/*", repo.WikiRaw)
}, repo.MustEnableWiki, context.CheckUnit(models.UnitTypeWiki), context.CheckUnit(models.UnitTypeWiki))
- m.Get("/archive/*", repo.MustBeNotBare, repo.Download, context.CheckUnit(models.UnitTypeCode))
+ m.Get("/archive/*", repo.MustBeNotBare, context.CheckUnit(models.UnitTypeCode), repo.Download)
m.Group("/pulls/:index", func() {
m.Get("/commits", context.RepoRef(), repo.ViewPullCommits)
@@ -617,10 +617,11 @@ func RegisterRoutes(m *macaron.Macaron) {
m.Get("/src/*", repo.SetEditorconfigIfExists, repo.Home)
m.Get("/forks", repo.Forks)
}, context.RepoRef(), context.CheckUnit(models.UnitTypeCode))
- m.Get("/commit/:sha([a-f0-9]{7,40})\\.:ext(patch|diff)", repo.MustBeNotBare, repo.RawDiff, context.CheckUnit(models.UnitTypeCode))
+ m.Get("/commit/:sha([a-f0-9]{7,40})\\.:ext(patch|diff)",
+ repo.MustBeNotBare, context.CheckUnit(models.UnitTypeCode), repo.RawDiff)
m.Get("/compare/:before([a-z0-9]{40})\\.\\.\\.:after([a-z0-9]{40})", repo.SetEditorconfigIfExists,
- repo.SetDiffViewStyle, repo.MustBeNotBare, repo.CompareDiff, context.CheckUnit(models.UnitTypeCode))
+ repo.SetDiffViewStyle, repo.MustBeNotBare, context.CheckUnit(models.UnitTypeCode), repo.CompareDiff)
}, ignSignIn, context.RepoAssignment(), context.UnitTypes(), context.LoadRepoUnits())
m.Group("/:username/:reponame", func() {
m.Get("/stars", repo.Stars)