app

package
v1.0.0-develop.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 31, 2018 License: GPL-3.0 Imports: 13 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AppVersion = "v0"

will be set on compile time

View Source
var HeaderFilter = func(c *revel.Controller, fc []revel.Filter) {

	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:])
}

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

View Source
var JsonParamsFilter = func(c *revel.Controller, fc []revel.Filter) {
	if strings.Contains(c.Request.ContentType, "application/json") {
		data := map[string]string{}
		request := c.Request.In.GetRaw().(*http.Request)
		content, _ := ioutil.ReadAll(request.Body)
		json.Unmarshal(content, &data)
		for k, v := range data {
			revel.TRACE.Println("application/json", k, v)
			c.Params.Values.Set(k, v)
		}
	}
	fc[0](c, fc[1:])
}

Functions

func InitDB

func InitDB()

func InitSocialRelay

func InitSocialRelay()

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL