summaryrefslogtreecommitdiffstats
path: root/cmd/web.go
diff options
context:
space:
mode:
authorUnknwon <joe2010xtmf@163.com>2014-11-06 22:06:41 -0500
committerUnknwon <joe2010xtmf@163.com>2014-11-06 22:06:41 -0500
commit23eec252748c3ac7af2ae310aeac4ee4c9061fe9 (patch)
tree9f9d8834ef94451da2fb1d43ba63d0f130d61f79 /cmd/web.go
parent4e7eb5be9d3e9c9ba7238769d2b5f2f471d51b67 (diff)
downloadgitea-23eec252748c3ac7af2ae310aeac4ee4c9061fe9.tar.gz
gitea-23eec252748c3ac7af2ae310aeac4ee4c9061fe9.zip
Fix #605, fix #255, fix #101
Diffstat (limited to 'cmd/web.go')
-rw-r--r--cmd/web.go20
1 files changed, 9 insertions, 11 deletions
diff --git a/cmd/web.go b/cmd/web.go
index 73cec968d0..289e07285f 100644
--- a/cmd/web.go
+++ b/cmd/web.go
@@ -370,7 +370,7 @@ func runWeb(*cli.Context) {
m.Group("/:username/:reponame", func() {
m.Post("/releases/new", bindIgnErr(auth.NewReleaseForm{}), repo.NewReleasePost)
m.Post("/releases/edit/:tagname", bindIgnErr(auth.EditReleaseForm{}), repo.EditReleasePost)
- }, reqSignIn, middleware.RepoAssignment(true, true))
+ }, reqSignIn, middleware.RepoAssignment(true))
m.Group("/:username/:reponame", func() {
m.Get("/issues", repo.Issues)
@@ -382,20 +382,18 @@ func runWeb(*cli.Context) {
}, ignSignIn, middleware.RepoAssignment(true))
m.Group("/:username/:reponame", func() {
- m.Get("/src/:branchname", repo.Home)
- m.Get("/src/:branchname/*", repo.Home)
- m.Get("/raw/:branchname/*", repo.SingleDownload)
- m.Get("/commits/:branchname", repo.Commits)
- m.Get("/commits/:branchname/search", repo.SearchCommits)
- m.Get("/commits/:branchname/*", repo.FileHistory)
- m.Get("/commit/:branchname", repo.Diff)
- m.Get("/commit/:branchname/*", repo.Diff)
+ m.Group("", func() {
+ m.Get("/src/*", repo.Home)
+ m.Get("/raw/*", repo.SingleDownload)
+ m.Get("/commits/*", repo.RefCommits)
+ m.Get("/commit/*", repo.Diff)
+ }, middleware.RepoRef())
m.Get("/releases", repo.Releases)
m.Get("/compare/:before([a-z0-9]+)...:after([a-z0-9]+)", repo.CompareDiff)
- }, ignSignIn, middleware.RepoAssignment(true, true))
+ }, ignSignIn, middleware.RepoAssignment(true))
m.Group("/:username", func() {
- m.Get("/:reponame", ignSignIn, middleware.RepoAssignment(true, true, true), repo.Home)
+ m.Get("/:reponame", ignSignIn, middleware.RepoAssignment(true, true), middleware.RepoRef(), repo.Home)
m.Any("/:reponame/*", ignSignInAndCsrf, repo.Http)
})