Help us shape the future of Go! Take the 2026 Go Developer Survey

originvalidator

package
v2.17.0 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OriginValidator

type OriginValidator struct {
	// contains filtered or unexported fields
}

func NewOriginValidator

func NewOriginValidator(startUrl *url.URL, allowedOriginsString string) *OriginValidator

NewOriginValidator creates a new validator from a comma-separated string of allowed origins

func (*OriginValidator) GetOriginFromURL

func (v *OriginValidator) GetOriginFromURL(urlString string) (string, error)

GetOriginFromURL extracts origin from URL string

func (*OriginValidator) IsOriginAllowed

func (v *OriginValidator) IsOriginAllowed(origin string) bool

IsOriginAllowed checks if the given origin is allowed

Jump to

Keyboard shortcuts

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