]> source.dussan.org Git - gitea.git/commitdiff
Fix #464
authorUnknwon <joe2010xtmf@163.com>
Mon, 15 Sep 2014 14:09:17 +0000 (10:09 -0400)
committerUnknwon <joe2010xtmf@163.com>
Mon, 15 Sep 2014 14:09:17 +0000 (10:09 -0400)
cmd/web.go

index e70380764392e49f5f0c0daa43f7a8bfbcb2395d..a9ff9dbcc2252d57ba23d5c7079e456f7c400853 100644 (file)
@@ -124,7 +124,7 @@ func runWeb(*cli.Context) {
 
        // Routers.
        m.Get("/", ignSignIn, routers.Home)
-       m.Get("/explore", routers.Explore)
+       m.Get("/explore", ignSignIn, routers.Explore)
        m.Get("/install", bindIgnErr(auth.InstallForm{}), routers.Install)
        m.Post("/install", bindIgnErr(auth.InstallForm{}), routers.InstallPost)
        m.Group("", func(r *macaron.Router) {
@@ -355,11 +355,9 @@ func runWeb(*cli.Context) {
        }, ignSignIn, middleware.RepoAssignment(true, true))
 
        m.Group("/:username", func(r *macaron.Router) {
-               r.Get("/:reponame", middleware.RepoAssignment(true, true, true), repo.Home)
-               m.Group("/:reponame", func(r *macaron.Router) {
-                       r.Any("/*", repo.Http)
-               })
-       }, ignSignInAndCsrf)
+               r.Get("/:reponame", ignSignIn, middleware.RepoAssignment(true, true, true), repo.Home)
+               r.Any("/:reponame/*", ignSignInAndCsrf, repo.Http)
+       })
 
        // Not found handler.
        m.NotFound(routers.NotFound)