Documentation
¶
Overview ¶
Package site computes what browsers call a site: a scheme and a registrable domain (public suffix list), the unit of SameSite cookies, sec-fetch-site and cookie partitions.
Registrable and Of are memoized per host: every request asks for them several times (sec-fetch-site, the cookie jar's SameSite context), and computing them allocates (the public suffix lookup, the IP parse).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsPublicSuffix ¶
IsPublicSuffix reports whether domain is a public suffix ("com", "co.uk"), where no cookie may be set for a whole domain.
func Loopback ¶
Loopback reports a loopback host (Secure Contexts): localhost, a name under .localhost, or a loopback IP address.
func Registrable ¶
Registrable returns host's registrable domain (eTLD+1), or the host itself for IP addresses and hosts without one.
func Trustworthy ¶
Trustworthy reports a potentially trustworthy URL (Secure Contexts): https or wss, or a loopback host.
Types ¶
This section is empty.