corsadaptor

package
v2.7.3 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package corsadaptor implements a filter that adapts CORS stuff.

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

func (a *CORSAdaptor) Handle(ctx *context.Context) string

Handle handles cross-origin requests.

func (*CORSAdaptor) Inherit

func (a *CORSAdaptor) Inherit(_ filters.Filter)

Inherit inherits previous generation of CORSAdaptor.

func (*CORSAdaptor) Init

func (a *CORSAdaptor) Init()

Init initializes CORSAdaptor.

func (*CORSAdaptor) Kind

func (a *CORSAdaptor) Kind() *filters.Kind

Kind returns the kind of CORSAdaptor.

func (*CORSAdaptor) Name

func (a *CORSAdaptor) Name() string

Name returns the name of the CORSAdaptor filter instance.

func (*CORSAdaptor) Spec

func (a *CORSAdaptor) Spec() filters.Spec

Spec returns the spec used by the CORSAdaptor

func (*CORSAdaptor) Status

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

Status return status.

type Spec

type Spec struct {
	filters.BaseSpec `json:",inline"`

	AllowedOrigins   []string `json:"allowedOrigins,omitempty"`
	AllowedMethods   []string `json:"allowedMethods,omitempty" jsonschema:"uniqueItems=true,format=httpmethod-array"`
	AllowedHeaders   []string `json:"allowedHeaders,omitempty"`
	AllowCredentials bool     `json:"allowCredentials,omitempty"`
	ExposedHeaders   []string `json:"exposedHeaders,omitempty"`
	MaxAge           int      `json:"maxAge,omitempty"`
}

Spec describes of CORSAdaptor.

Jump to

Keyboard shortcuts

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