Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct { AllowedOrigins []string `json:"allowedOrigins,omitempty"` AllowedMethods []string `json:"allowedMethods,omitempty"` AllowedHeaders []string `json:"allowedHeaders,omitempty"` ExposedHeaders []string `json:"exposedHeaders,omitempty"` AllowCredentials bool `json:"allowCredentials,omitempty"` OptionsPassthrough bool `json:"optionsPassthrough,omitempty"` MaxAge int `json:"maxAge,omitempty"` Debug bool `json:"debug,omitempty"` }
Config the plugin configuration.
func CreateConfig ¶
func CreateConfig() *Config
CreateConfig creates the default plugin configuration.
type CorsTraefik ¶ added in v0.1.1
CorsTraefik a plugin.
func (*CorsTraefik) ServeHTTP ¶ added in v0.1.1
func (e *CorsTraefik) ServeHTTP(rw http.ResponseWriter, req *http.Request)
Directories ¶
Path | Synopsis |
---|---|
Package cors is net/http handler to handle CORS related requests as defined by http://www.w3.org/TR/cors/ You can configure it by passing an option struct to cors.New: c := cors.New(cors.Options{ AllowedOrigins: []string{"foo.com"}, AllowedMethods: []string{http.MethodGet, http.MethodPost, http.MethodDelete}, AllowCredentials: true, }) Then insert the handler in the chain: handler = c.Handler(handler) See Options documentation for more options.
|
Package cors is net/http handler to handle CORS related requests as defined by http://www.w3.org/TR/cors/ You can configure it by passing an option struct to cors.New: c := cors.New(cors.Options{ AllowedOrigins: []string{"foo.com"}, AllowedMethods: []string{http.MethodGet, http.MethodPost, http.MethodDelete}, AllowCredentials: true, }) Then insert the handler in the chain: handler = c.Handler(handler) See Options documentation for more options. |
Click to show internal directories.
Click to hide internal directories.