cors

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// EnableMiddleware indicates whether or not CORS middleware is enabled to
	// enforce policies on cross origin requests
	EnableMiddleware bool
	// AllowedOrigins indicates which origins allow responses to be populated
	// with headers to allow cross origin requests (e.g. "*" or
	// "https://example.com")
	AllowedOrigins string
	// AllowedMethods indicates which methods allow responses to be populated
	// with headers to allow cross origin requests (e.g. "POST, GET, OPTIONS,
	// PUT, DELETE")
	AllowedMethods string
	// AllowedHeaders indicates which headers are allowed for cross origin
	// requests (e.g. "*" or "Accept, Content-Type, Content-Length")
	AllowedHeaders string
}

Config contains configuration for the cors package

func (Config) GetHTTPServerMiddleware

func (c Config) GetHTTPServerMiddleware() mux.MiddlewareFunc

GetHTTPServerMiddleware returns middleware that adds cors header options to the response and short-circuits further request processing if the request method is OPTIONS.

func (*Config) RegisterFlags

func (c *Config) RegisterFlags(flags *pflag.FlagSet)

RegisterFlags registers JOSE flags with pflags

Jump to

Keyboard shortcuts

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