Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
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 NullInt64Binder = revel.Binder{ Bind: func(params *revel.Params, name string, typ reflect.Type) reflect.Value { vals, ok := params.Values[name] if !ok || len(vals) == 0 { return reflect.Zero(typ) } intValue, err := strconv.ParseInt(vals[0], 10, 64) if err != nil { fmt.Println(err) return reflect.Zero(typ) } pValue := reflect.New(typ) pValue.Elem().Set(reflect.ValueOf(sql.NullInt64{intValue, true})) return pValue.Elem() }, Unbind: func(output map[string]string, key string, val interface{}) { output[key] = fmt.Sprintf("%d", val) }, }
Functions ¶
This section is empty.
Types ¶
This section is empty.
Directories ¶
Path | Synopsis |
---|---|
GENERATED CODE - DO NOT EDIT
|
GENERATED CODE - DO NOT EDIT |
GENERATED CODE - DO NOT EDIT
|
GENERATED CODE - DO NOT EDIT |
Click to show internal directories.
Click to hide internal directories.