cors

package
v1.14.2 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2025 License: Apache-2.0 Imports: 5 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CORS

type CORS struct {
	Enabled bool

	// allow configuration
	AllowOrigins     []string
	AllowMethods     []string
	AllowHeaders     []string
	AllowCredentials bool
	ExposeHeaders    []string

	// preflight
	PreflightRequestMethod string
	PreflightMaxAgeSeconds *int
	// contains filtered or unexported fields
}

func NewCORS

func NewCORS() *CORS

func (*CORS) EncodeAllowCredentialsHeader

func (c *CORS) EncodeAllowCredentialsHeader() string

func (*CORS) EncodeAllowHeaders

func (c *CORS) EncodeAllowHeaders() string

func (*CORS) EncodeExposeHeaders

func (c *CORS) EncodeExposeHeaders() string

func (*CORS) EncodePreflightMaxAgeSeconds

func (c *CORS) EncodePreflightMaxAgeSeconds() string

func (*CORS) EncodedAllowMethods

func (c *CORS) EncodedAllowMethods() string

func (*CORS) HeadersAllowed

func (c *CORS) HeadersAllowed(headers []string) bool

func (*CORS) MethodAllowed

func (c *CORS) MethodAllowed(method string) bool

func (*CORS) OriginAllowed

func (c *CORS) OriginAllowed(origin string) bool

Jump to

Keyboard shortcuts

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