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 ¶
Click to show internal directories.
Click to hide internal directories.