Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ContentTypeFilter = func(c *revel.Controller, fc []revel.Filter) { path := c.Request.Request.URL.Path formats := []string{"json", "xml"} for _, format := range formats { if strings.HasSuffix(path, "."+format) { trimmed := strings.TrimSuffix(path, "."+format) c.Request.Request.URL.Path = trimmed c.Request.Request.RequestURI = trimmed c.Request.Format = format break } } fc[0](c, fc[1:]) }
View Source
var HeaderFilter = func(c *revel.Controller, fc []revel.Filter) {
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
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.