Documentation ¶
Index ¶
Constants ¶
View Source
const (
AllowedDomainsRegexPrefix = "re:"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CrossOriginResourceSharing ¶
type CrossOriginResourceSharing struct { ExposeHeaders []string // list of exposed Headers AllowedHeaders []string // list of allowed Headers AllowedDomains []string // list of allowed values for Http Origin. An allowed value can be a regular expression to support subdomain matching. If empty all are allowed. AllowedMethods []string // list of allowed Methods MaxAge int // number of seconds that indicates how long the results of a preflight request can be cached. CookiesAllowed bool Container *restful.Container }
CrossOriginResourceSharing is used to create a Container Filter that implements CORS. Cross-origin resource sharing (CORS) is a mechanism that allows JavaScript on a web page to make XMLHttpRequests to another domain, not the domain the JavaScript originated from.
http://en.wikipedia.org/wiki/Cross-origin_resource_sharing http://enable-cors.org/server.html https://web.dev/cross-origin-resource-sharing
func (CrossOriginResourceSharing) Filter ¶
func (c CrossOriginResourceSharing) Filter(req *restful.Request, resp *restful.Response, chain *restful.FilterChain)
Filter is a filter function that implements the CORS flow
Click to show internal directories.
Click to hide internal directories.