originvalidator

package
v2.11.0 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2025 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