cors

package
v0.0.0-...-a839d2f Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CORS

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

func (*CORS) Handle

func (c *CORS) Handle(request *request.Request, writer http.ResponseWriter) *response.AsObject

type CORSOption

type CORSOption func(*CORS)

func AllowedHeaders

func AllowedHeaders(headers ...string) CORSOption

func AllowedMethods

func AllowedMethods(methods ...string) CORSOption

func AllowedOrigins

func AllowedOrigins(origins ...string) CORSOption

type OriginValidator

type OriginValidator func(string) bool

OriginValidator takes an origin string and returns whether or not that origin is allowed.

Jump to

Keyboard shortcuts

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