aboutsummaryrefslogtreecommitdiffstats
path: root/web.go
diff options
context:
space:
mode:
authorUnknown <joe2010xtmf@163.com>2014-04-10 14:37:51 -0400
committerUnknown <joe2010xtmf@163.com>2014-04-10 14:37:51 -0400
commit29e255422e706b24e4ba8f4e1830a46da66d5269 (patch)
tree7fe329d1b5feaba764c46bdcb6ec4424b595c2d3 /web.go
parentaf552596cfd7f6fd05dfc38abaaffad1d7fed654 (diff)
parenta24c0b92e4ad847fbd774e604e80017368f25495 (diff)
downloadgitea-29e255422e706b24e4ba8f4e1830a46da66d5269.tar.gz
gitea-29e255422e706b24e4ba8f4e1830a46da66d5269.zip
Merge branch 'dev' of github.com:gogits/gogs into dev
Diffstat (limited to 'web.go')
-rw-r--r--web.go9
1 files changed, 7 insertions, 2 deletions
diff --git a/web.go b/web.go
index 0f61bc2147..962ad7445d 100644
--- a/web.go
+++ b/web.go
@@ -11,10 +11,10 @@ import (
"github.com/codegangsta/cli"
"github.com/go-martini/martini"
+
qlog "github.com/qiniu/log"
"github.com/gogits/binding"
-
"github.com/gogits/gogs/modules/auth"
"github.com/gogits/gogs/modules/avatar"
"github.com/gogits/gogs/modules/base"
@@ -72,6 +72,11 @@ func runWeb(*cli.Context) {
reqSignIn := middleware.Toggle(&middleware.ToggleOptions{SignInRequire: true})
ignSignIn := middleware.Toggle(&middleware.ToggleOptions{SignInRequire: base.Service.RequireSignInView})
+ ignSignInAndCsrf := middleware.Toggle(&middleware.ToggleOptions{
+ SignInRequire: base.Service.RequireSignInView,
+ DisableCsrf: true,
+ })
+
reqSignOut := middleware.Toggle(&middleware.ToggleOptions{SignOutRequire: true})
bindIgnErr := binding.BindIgnErr
@@ -169,7 +174,7 @@ func runWeb(*cli.Context) {
m.Group("/:username", func(r martini.Router) {
r.Any("/:reponame/**", repo.Http)
r.Get("/:reponame", middleware.RepoAssignment(true, true, true), repo.Single)
- }, ignSignIn)
+ }, ignSignInAndCsrf)
// Not found handler.
m.NotFound(routers.NotFound)