Documentation
¶
Index ¶
Constants ¶
View Source
const ( RootPluginName = "http" PluginName = "headers" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CORSConfig ¶
type CORSConfig struct {
// AllowedOrigin: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Origin
AllowedOrigin string `mapstructure:"allowed_origin"`
// AllowedHeaders: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Headers
AllowedHeaders string `mapstructure:"allowed_headers"`
// AllowedMethods: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Methods
AllowedMethods string `mapstructure:"allowed_methods"`
// AllowCredentials https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Credentials
AllowCredentials *bool `mapstructure:"allow_credentials"`
// ExposeHeaders: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Expose-Headers
ExposedHeaders string `mapstructure:"exposed_headers"`
// MaxAge of CORS headers in seconds/
MaxAge int `mapstructure:"max_age"`
}
type Config ¶
type Config struct {
// CORS settings.
CORS *CORSConfig `mapstructure:"cors"`
// Request headers to add to every request.
Request map[string]string `mapstructure:"request"`
// Response headers to add to every response.
Response map[string]string `mapstructure:"response"`
}
Config declares headers service configuration.
Click to show internal directories.
Click to hide internal directories.