skipper: Index | Files

package cors

import ""

Package cors implements the origin header for CORS.

How It Works

The filter accepts an optional variadic list of acceptable origin parameters. If the input argument list is empty, the header will always be set to '*' which means any origin is acceptable. Otherwise the header is only set if the request contains an Origin header and its value matches one of the elements in the input list. The header is only set on the response.


corsOrigin("", "http://localhost:9001")


Package Files

cors.go doc.go

func NewOrigin Uses

func NewOrigin() filters.Spec

NewOrigin creates a CORS origin handler that can check for allowed origin or set an all allowed header

Package cors imports 1 packages (graph) and is imported by 3 packages. Updated 2019-10-30. Refresh now. Tools for package owners.