Versions in this module Expand all Collapse all v0 v0.0.7 Oct 27, 2026 v0.0.6 Oct 16, 2026 v0.0.5 Oct 12, 2026 Changes in this version + var ErrNotAnOrigin = errors.New("not an http(s) origin") + func Contains(set []Origin, o Origin) bool + func HasBearer(r *http.Request) bool + func HostAllowed(host string, names []string) bool + func IsJSON(contentType string) bool + func IsMultipartForm(contentType string) bool + func PeerAddr(r *http.Request) (netip.Addr, bool) + func SplitHostPort(hostport string) (host string, port int, err error) + func Unsafe(method string) bool + type Origin struct + Host string + Port int + Scheme string + func FromHost(scheme, hostport string) (Origin, error) + func Parse(s string) (Origin, error) + func ParseEntries(entries []string) (origins []Origin, bad []string) + func ParseEntry(s string) (Origin, error) + func (o Origin) IsZero() bool + func (o Origin) String() string + type Proxies struct + func MustParseProxies(entries ...string) Proxies + func ParseProxies(entries []string) (Proxies, error) + func (p Proxies) ClientIP(r *http.Request) string + func (p Proxies) Entries() []string + func (p Proxies) Trusts(a netip.Addr) bool + func (p Proxies) TrustsPeer(r *http.Request) bool + type Reason string + const ReasonBearer + const ReasonCrossSite + const ReasonForeignOrigin + const ReasonMediaType + const ReasonNoOrigin + const ReasonOwnOrigin + const ReasonSafeMethod + const ReasonSameOrigin + const ReasonSameSite + const ReasonUnknownFetchSite + const ReasonUnknownHost + const ReasonUserInitiated + func RefusalReasons() []Reason + type Verdict struct + Allowed bool + FetchSite string + Origin string + Reason Reason + func CheckUnsafe(r *http.Request, own []Origin) Verdict + func CheckUpgrade(r *http.Request, own []Origin) Verdict + type View struct + Host string + Scheme string + func ViewOf(r *http.Request, trusted bool) View + func (v View) Origin() (Origin, bool) + func (v View) TLS() bool