MCPcopy Index your code
hub / github.com/PyGithub/PyGithub / __hostnameHasDomain

Method __hostnameHasDomain

github/Requester.py:887–893  ·  view source on GitHub ↗
(cls, hostname: str, domain_or_domains: str | list[str])

Source from the content-addressed store, hash-verified

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)

Callers 2

__assertUrlAllowedMethod · 0.95
testHostnameHasDomainMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected