Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClientFieldSpec ¶
ClientFieldSpec returns a field spec for an http client component.
func ServerCORSFieldSpec ¶
ServerCORSFieldSpec returns a field spec for an http server CORS component.
Types ¶
type ServerCORS ¶
type ServerCORS struct { Enabled bool `json:"enabled" yaml:"enabled"` AllowedOrigins []string `json:"allowed_origins" yaml:"allowed_origins"` }
ServerCORS contains configuration for allowing CORS headers.
func NewServerCORS ¶
func NewServerCORS() ServerCORS
NewServerCORS returns a new server CORS config with default fields.
func (ServerCORS) WrapHandler ¶
WrapHandler wraps a provided HTTP handler with middleware that enables CORS requests (when configured).
Click to show internal directories.
Click to hide internal directories.