mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-12-29 07:03:55 +03:00
Fix route handler order (#2409)
* Fix route handler order * Fix more routes
This commit is contained in:
parent
15d3872281
commit
491f0ebc58
1 changed files with 4 additions and 3 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue