cors

package
v0.0.0-...-914eb61 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// HeaderOrigin is for allowed specific domains
	HeaderOrigin = "Access-Control-Allow-Origin"
	// HeaderHeaders is for allowed headers from browser
	HeaderHeaders = "Access-Control-Allow-Headers"
	// HeaderMethods is for allowed method from browser
	HeaderMethods = "Access-Control-Allow-Methods"
	// HeaderCredentials is whether credentials are used of not
	HeaderCredentials = "Access-Control-Allow-Credentials"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CORSer

type CORSer interface {
	ValidateHeader(ctx *gin.Context) error
	SetResponseHeader(ctx *gin.Context)
}

CORSer interface

func NewCORS

func NewCORS(
	logger *zap.Logger,
	corsConf *config.CORS,
) CORSer

NewCORS returns CORSer interface

Jump to

Keyboard shortcuts

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