weborigin

package
v1.4.26 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package weborigin validates and compares browser-visible HTTP origins.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Normalize

func Normalize(raw string) (string, error)

Normalize validates and canonicalizes a browser-visible HTTP(S) origin. A root path is accepted and removed; all other URL components are rejected.

func Same

func Same(candidate, expected string, allowPath bool) bool

Same reports whether candidate has the same normalized scheme, host, and effective port as expected. Referers may include a path and query; Origin values may contain only an empty or root path.

Types

This section is empty.

Jump to

Keyboard shortcuts

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