Remove legacy source provider sync path
This commit is contained in:
@@ -1,6 +1,16 @@
|
||||
import ipaddress
|
||||
import re
|
||||
|
||||
def hostname_matches_domain(hostname: str, domain: str) -> bool:
|
||||
"""Match a domain apex and any subdomain, without suffix false positives."""
|
||||
candidate = hostname.lower().rstrip(".")
|
||||
if candidate.startswith("*."):
|
||||
candidate = candidate[2:]
|
||||
|
||||
base = domain.lower().rstrip(".")
|
||||
return candidate == base or candidate.endswith("." + base)
|
||||
|
||||
|
||||
_LABEL_RE = re.compile(r"^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$")
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user