cors

package
v6.0.0-...-03bcada Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2017 License: MIT, MIT Imports: 2 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Default

func Default() iris.RouterWrapperPolicy

Default returns a New cors wrapper with the default options accepting GET and POST requests and allowing all origins.

func New

func New(opts Options) iris.RouterWrapperPolicy

New returns a new cors router wrapper policy with the provided options.

create a new cors middleware, pass its options (casted) and pass the .ServeHTTP(w,r,next(http.HandlerFunc)) as the wrapper for the whole iris' Router

Unlike the cors middleware, this wrapper wraps the entirely router, it cannot be registered to specific routes. It works better and all Options are working.

Types

type Options

type Options cors.Options

Options is a configuration container to setup the CORS.

Jump to

Keyboard shortcuts

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