AllowedHostMatcher
final class AllowedHostMatcher (View source)
| internal |
Compiles exact hostnames and bounded suffix wildcards for request-origin validation.
Methods
Validates and compiles host patterns without interpreting an empty list as unrestricted access.
Reports whether a normalized request host matches one explicit pattern.
Reports whether a host is an IP literal or a canonical ASCII DNS hostname.
Canonicalizes case and one DNS root marker before comparison.
Details
__construct
__construct(array $allowedHosts = [])
Validates and compiles host patterns without interpreting an empty list as unrestricted access.
allows
bool
allows(string $host)
Reports whether a normalized request host matches one explicit pattern.
isValidHost
bool
isValidHost(string $host)
Reports whether a host is an IP literal or a canonical ASCII DNS hostname.
normalizeHost
string
normalizeHost(string $host)
Canonicalizes case and one DNS root marker before comparison.