cors

package
v0.0.0-...-40240cb Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: MPL-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllowAllOrigin

func AllowAllOrigin(next http.HandlerFunc) http.HandlerFunc

func AllowHeaders

func AllowHeaders(headers ...string) corsOption

func AllowMethods

func AllowMethods(methods ...string) corsOption

func AllowOrigin

func AllowOrigin(origin string) corsOption

func CORS

func CORS(opts ...corsOption) func(http.HandlerFunc) http.HandlerFunc

Default allows all origins methods, all headers, and sets the max age to 1 day. Acts as a terminal middleware if the request is an OPTIONS request.

func MaxAge

func MaxAge(d time.Duration) corsOption

Types

This section is empty.

Jump to

Keyboard shortcuts

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