skipper: github.com/zalando/skipper/filters/cors Index | Files

package cors

import "github.com/zalando/skipper/filters/cors"

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.

Usage

corsOrigin()
corsOrigin("https://www.example.org")
corsOrigin("https://www.example.org", "http://localhost:9001")

Index

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 2 packages. Updated 2018-03-26. Refresh now. Tools for package owners.