summaryrefslogtreecommitdiff
path: root/app/init.go
diff options
context:
space:
mode:
authorHorus32015-02-10 08:33:42 +0100
committerHorus32015-02-10 08:33:42 +0100
commit8c30749613bcf1ce47fff0a6d1a60c34f91f01c4 (patch)
tree98354473d929cbc9749f08ea0afdf90993a01480 /app/init.go
parentaf1f4677c685e8a2c4967ffa0350d314a6543db7 (diff)
downloadwebmon-8c30749613bcf1ce47fff0a6d1a60c34f91f01c4.tar.gz
Basic user control.
Diffstat (limited to 'app/init.go')
-rw-r--r--app/init.go9
1 files changed, 7 insertions, 2 deletions
diff --git a/app/init.go b/app/init.go
index 2305d73..b13043a 100644
--- a/app/init.go
+++ b/app/init.go
@@ -1,6 +1,10 @@
package app
-import "github.com/revel/revel"
+import (
+ "github.com/anonx/cachesession"
+ "github.com/cbonello/revel-csrf"
+ "github.com/revel/revel"
+)
func init() {
// Filters is the default set of global filters.
@@ -9,8 +13,9 @@ func init() {
revel.RouterFilter, // Use the routing table to select the right Action
revel.FilterConfiguringFilter, // A hook for adding or removing per-Action filters.
revel.ParamsFilter, // Parse parameters into Controller.Params.
- revel.SessionFilter, // Restore and write the session cookie.
+ cachesession.Filter, // Restore and write the session cookie.
revel.FlashFilter, // Restore and write the flash cookie.
+ csrf.CSRFFilter, // CSRF protection
revel.ValidationFilter, // Restore kept validation errors and save new ones from cookie.
revel.I18nFilter, // Resolve the requested language
HeaderFilter, // Add some security based headers