corsadaptor

package
v1.5.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 28, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

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) Close

func (a *CORSAdaptor) Close()

Close closes CORSAdaptor.

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.

func (*CORSAdaptor) Status

func (a *CORSAdaptor) Status() interface{}

Status return status.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL