cors

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Allow

func Allow(opts *Options) bhojpur.FilterFunc

Allow enables CORS for requests those match the provided options.

Types

type Options

type Options cors.Options

Options represents Access Control options.

func (*Options) Header

func (o *Options) Header(origin string) (headers map[string]string)

Header converts options into CORS headers.

func (*Options) IsOriginAllowed

func (o *Options) IsOriginAllowed(origin string) bool

IsOriginAllowed looks up if the origin matches one of the patterns generated from Options.AllowOrigins patterns.

func (*Options) PreflightHeader

func (o *Options) PreflightHeader(origin, rMethod, rHeaders string) (headers map[string]string)

PreflightHeader converts options into CORS headers for a preflight response.

Jump to

Keyboard shortcuts

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