Documentation ¶
Index ¶
- Constants
- type CORSAdaptor
- func (a *CORSAdaptor) Close()
- func (a *CORSAdaptor) DefaultSpec() interface{}
- func (a *CORSAdaptor) Description() string
- func (a *CORSAdaptor) Handle(ctx context.HTTPContext) string
- func (a *CORSAdaptor) Inherit(filterSpec *httppipeline.FilterSpec, previousGeneration httppipeline.Filter)
- func (a *CORSAdaptor) Init(filterSpec *httppipeline.FilterSpec)
- func (a *CORSAdaptor) Kind() string
- func (a *CORSAdaptor) Results() []string
- func (a *CORSAdaptor) Status() interface{}
- type Spec
Constants ¶
View Source
const (
// Kind is kind of CORSAdaptor.
Kind = "CORSAdaptor"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CORSAdaptor ¶
type CORSAdaptor struct {
// contains filtered or unexported fields
}
CORSAdaptor is filter for CORS request.
func (*CORSAdaptor) DefaultSpec ¶
func (a *CORSAdaptor) DefaultSpec() interface{}
DefaultSpec returns default spec of CORSAdaptor.
func (*CORSAdaptor) Description ¶
func (a *CORSAdaptor) Description() string
Description returns the description of CORSAdaptor.
func (*CORSAdaptor) Handle ¶
func (a *CORSAdaptor) Handle(ctx context.HTTPContext) string
Handle handles simple cross-origin requests or directs.
func (*CORSAdaptor) Inherit ¶
func (a *CORSAdaptor) Inherit(filterSpec *httppipeline.FilterSpec, previousGeneration httppipeline.Filter)
Inherit inherits previous generation of CORSAdaptor.
func (*CORSAdaptor) Init ¶
func (a *CORSAdaptor) Init(filterSpec *httppipeline.FilterSpec)
Init initializes CORSAdaptor.
func (*CORSAdaptor) Kind ¶
func (a *CORSAdaptor) Kind() string
Kind returns the kind of CORSAdaptor.
func (*CORSAdaptor) Results ¶
func (a *CORSAdaptor) Results() []string
Results returns the results of CORSAdaptor.
type Spec ¶
type Spec struct { AllowedOrigins []string `yaml:"allowedOrigins" jsonschema:"omitempty"` AllowedMethods []string `yaml:"allowedMethods" jsonschema:"omitempty,uniqueItems=true,format=httpmethod-array"` AllowedHeaders []string `yaml:"allowedHeaders" jsonschema:"omitempty"` AllowCredentials bool `yaml:"allowCredentials" jsonschema:"omitempty"` ExposedHeaders []string `yaml:"exposedHeaders" jsonschema:"omitempty"` MaxAge int `yaml:"maxAge" jsonschema:"omitempty"` // If true, handle requests with 'Origin' header. https://fetch.spec.whatwg.org/#http-requests // By default, only CORS-preflight requests are handled. SupportCORSRequest bool `yaml:"supportCORSRequest" jsonschema:"omitempty"` }
Spec describes of CORSAdaptor.
Click to show internal directories.
Click to hide internal directories.