Expand description
Referer allow/deny list plugin (referer-restriction).
Port of APISIX’s referer-restriction: parses the host out of the
Referer request header and matches it against a whitelist or blacklist
of host patterns (exact hosts or leading-* wildcards). Rejections are
routed through the node’s error port with error code REFERER_RESTRICTED.
Structs§
- Host
Matcher 🔒 - Pre-split host patterns: exact hosts and
*-prefix wildcard suffixes (mirrors APISIX’screate_host_matcher). - Referer
Restriction Plugin - Restricts access based on the host of the
Refererrequest header.
Functions§
- parse_
host_ 🔒list - Parses a config key as an array of host patterns. Patterns starting with
*become suffix matches on the remainder; others are exact (lowercased). - referer_
host 🔒 - Extracts the lowercased host from a Referer value. Only
http/httpsURLs parse (APISIXhttp.parse_uriparity); anything else — including a bare host without a scheme — is treated as malformed and returnsNone.