cors

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: May 14, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const KeyAmpSameOriginHeader string = "AMP-Same-Origin"
View Source
const KeyAmpSourceOrigin string = "__amp_source_origin"

Variables

This section is empty.

Functions

This section is empty.

Types

type Cors

type Cors struct {

	//seconds to cache the response
	MaxAgeSeconds int
	// contains filtered or unexported fields
}

func NewCors

func NewCors(origins []string, methods []string, headers []string) *Cors

func (Cors) AMP

func (c Cors) AMP() bool

func (Cors) AMPForUrl

func (c Cors) AMPForUrl(url string) bool

func (*Cors) EnableAmpFetch

func (c *Cors) EnableAmpFetch(urls []string)

sets the list of allowed AMP urls

func (*Cors) HandleOptions

func (c *Cors) HandleOptions(w http.ResponseWriter, origin string) bool

returns true if origin has been allowed

func (*Cors) ValidateAMP

func (c *Cors) ValidateAMP(w http.ResponseWriter, source string) error

Jump to

Keyboard shortcuts

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