cors

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2024 License: BSD-3-Clause Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	AllowedOrigins   []string `yaml:"allowed_origins"`
	AllowedMethods   []string `yaml:"allowed_methods"`
	AllowedHeaders   []string `yaml:"allowed_headers"`
	ExposedHeaders   []string `yaml:"exposed_headers"`
	AllowCredentials bool     `yaml:"allow_credentials"`
	MaxAge           int      `yaml:"max_age"`
}

type Cors

type Cors struct {
	// contains filtered or unexported fields
}

func (Cors) AddActualRequestHeaders

func (c Cors) AddActualRequestHeaders(request contracts.RequestContract, response contracts.ResponseContract) contracts.ResponseContract

func (Cors) ConfigureAllowCredentials

func (c Cors) ConfigureAllowCredentials(response contracts.ResponseContract)

func (Cors) ConfigureAllowedHeaders

func (c Cors) ConfigureAllowedHeaders(request contracts.RequestContract, response contracts.ResponseContract)

func (Cors) ConfigureAllowedMethods

func (c Cors) ConfigureAllowedMethods(request contracts.RequestContract, response contracts.ResponseContract)

func (Cors) ConfigureAllowedOrigin

func (c Cors) ConfigureAllowedOrigin(request contracts.RequestContract, response contracts.ResponseContract)

func (Cors) ConfigureExposedHeaders

func (c Cors) ConfigureExposedHeaders(response contracts.ResponseContract)

func (Cors) ConfigureMaxAge

func (c Cors) ConfigureMaxAge(response contracts.ResponseContract)

func (Cors) HandlePreflightRequest

func (c Cors) HandlePreflightRequest(request contracts.RequestContract) contracts.ResponseContract

func (Cors) VaryHeader

func (c Cors) VaryHeader(response contracts.ResponseContract, header string) contracts.ResponseContract

type Middleware

type Middleware struct {
	// contains filtered or unexported fields
}

func NewMiddleware

func NewMiddleware(config Config) *Middleware

func (*Middleware) Handle

Jump to

Keyboard shortcuts

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