Skip to main content

Module domain_guard

Module domain_guard 

Expand description

Shared domain/URL validation and allowlist helpers.

Functionsยง

host_matches_allowlist
is_private_or_local_host
Check whether host is a private, loopback, link-local, or otherwise non-globally-routable address (SSRF guard). Handles both IPv4 and IPv6, as well as localhost and .local domains. True when host is loopback, private, link-local, a documentation/ benchmark range, or one of the localhost / *.local name forms. Accepts bracketed IPv6 ([::1]) and is case-insensitive.
normalize_allowed_domains
normalize_domain