Documentation
¶
Overview ¶
Package schemehost compares the scheme and host of two URLs for same-origin checks. It is shared by the CSRF middleware (Origin/Referer validation), the core redirect logic (open-redirect prevention) and the proxy Balancer.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Match ¶
Match reports whether (schemeA, hostA) and (schemeB, hostB) denote the same origin. Scheme comparison is case-insensitive and default ports (http:80, https:443) are normalized so "example.com" and "example.com:443" match.
func MatchStrict ¶ added in v3.7.0
MatchStrict is Match for one scheme without the url.Parse fallback: a value that is not a plain host with an optional port matches nothing, so no other parser can read it as another host.
Types ¶
This section is empty.