diff options
| author | Horus_Arch | 2015-03-02 15:31:39 +0100 |
|---|---|---|
| committer | Horus_Arch | 2015-03-02 15:31:39 +0100 |
| commit | e31b06b7b56aaf1cf5510d4bb0261f73bc0e8893 (patch) | |
| tree | 0651cdd688659b845f3605e09384161b3c0334db /app/init.go | |
| parent | cf66deeeba38263feef0ca4123a983cb78ce5cac (diff) | |
| download | webmon-master.tar.gz | |
Diffstat (limited to 'app/init.go')
| -rw-r--r-- | app/init.go | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/app/init.go b/app/init.go deleted file mode 100644 index b13043a..0000000 --- a/app/init.go +++ /dev/null @@ -1,43 +0,0 @@ -package app - -import ( - "github.com/anonx/cachesession" - "github.com/cbonello/revel-csrf" - "github.com/revel/revel" -) - -func init() { - // Filters is the default set of global filters. - revel.Filters = []revel.Filter{ - revel.PanicFilter, // Recover from panics and display an error page instead. - 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. - 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 - revel.InterceptorFilter, // Run interceptors around the action. - revel.CompressFilter, // Compress the result. - revel.ActionInvoker, // Invoke the action. - } - - // register startup functions with OnAppStart - // ( order dependent ) - // revel.OnAppStart(InitDB) - // revel.OnAppStart(FillCache) -} - -// TODO turn this into revel.HeaderFilter -// should probably also have a filter for CSRF -// not sure if it can go in the same filter or not -var HeaderFilter = func(c *revel.Controller, fc []revel.Filter) { - // Add some common security headers - c.Response.Out.Header().Add("X-Frame-Options", "SAMEORIGIN") - c.Response.Out.Header().Add("X-XSS-Protection", "1; mode=block") - c.Response.Out.Header().Add("X-Content-Type-Options", "nosniff") - - fc[0](c, fc[1:]) // Execute the next filter stage. -} |
