cors

package
v0.13.4 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2024 License: MIT Imports: 5 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 {
	AllowOrigins     AllowOriginFunc
	AllowMethods     []string
	AllowHeaders     []string
	ExposeHeaders    []string
	MaxAge           time.Duration
	AllowAllOrigins  bool
	AllowCredentials bool
}

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