(cls, hostname: str, domain_or_domains: str | list[str])
| 885 | |
| 886 | @classmethod |
| 887 | def __hostnameHasDomain(cls, hostname: str, domain_or_domains: str | list[str]) -> bool: |
| 888 | if isinstance(domain_or_domains, str): |
| 889 | if hostname == domain_or_domains: |
| 890 | return True |
| 891 | domain_suffix = f".{domain_or_domains}" |
| 892 | return hostname.endswith(domain_suffix) |
| 893 | return any(cls.__hostnameHasDomain(hostname, d) for d in domain_or_domains) |
| 894 | |
| 895 | def __assertUrlAllowed(self, url: str) -> None: |
| 896 | o = urllib.parse.urlparse(url) |
no outgoing calls
no test coverage detected