Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Handler ¶
type Handler func(http.ResponseWriter, *http.Request)
func AllowAll ¶
func AllowAll() Handler
Creates a CORS Handler that allows all origins by setting "Access-Control-Allow-Origin" header to "*". This means any domain can access resources on your server. It also specifies allowed methods and headers.
func GetGlobalPolicy ¶
func GetGlobalPolicy() Handler
Retrieves the currently set global CORS policy handler.
func SameOrigin ¶
Creates a CORS Handler that allows requests from the origin within the specified second-level domain scopes. For example:
SameOrigin("domain1.com", "domain2.com")
will allow requests from http://app1.domain1.com:8080 or https://app2.domain2.com.
Click to show internal directories.
Click to hide internal directories.