Documentation
¶
Overview ¶
Package urlhost normalizes URL domain names without acquiring network capabilities.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidHost = errors.New("invalid URL host")
var ErrInvalidOrigin = errors.New("invalid URL origin")
Functions ¶
func Normalize ¶
Normalize gives Unicode and Punycode spellings one domain representation. It changes only the host: paths and query credentials retain their exact bytes. ASCII hosts without A-labels, including IP literals, need no IDNA processing.
func Origin ¶ added in v0.1.7
Origin returns the canonical ASCII origin ("scheme://host[:port]") for an HTTP(S) or WebSocket URL, matching browser origin serialization: lowercase scheme and ASCII host, IDNA Punycode for Unicode domains, WHATWG IPv6 formatting, and default ports (80/443) omitted. It does not mutate u.
Types ¶
This section is empty.