cors

package
v0.12.2 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2023 License: MIT Imports: 4 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AllowOriginFunc added in v0.12.2

type AllowOriginFunc func(origin string) bool

func AllowOrigins added in v0.12.2

func AllowOrigins(origins ...string) AllowOriginFunc

type CORS

type CORS struct {
	AllowAllOrigins  bool
	AllowOrigins     AllowOriginFunc
	AllowMethods     []string
	AllowHeaders     []string
	AllowCredentials bool
	ExposeHeaders    []string
	MaxAge           time.Duration
}

CORS middleware

func New

func New() *CORS

New creates new default cors middleware for public api

func (CORS) ServeHandler

func (m CORS) ServeHandler(h http.Handler) http.Handler

ServeHandler implements middleware interface

Jump to

Keyboard shortcuts

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