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

Method __assertUrlAllowed

github/Requester.py:895–903  ·  view source on GitHub ↗
(self, url: str)

Source from the content-addressed store, hash-verified

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)
897 assert o.hostname is not None
898 if o.hostname == self.__hostname:
899 prefixes = [self.__prefix, self.__graphql_prefix, "/api/", "/login/oauth"]
900 assert o.path.startswith(tuple(prefixes)), o.path
901 assert o.port == self.__port, o.port
902 else:
903 assert self.__hostnameHasDomain(o.hostname, self.__domains), o.hostname
904
905 def __customConnection(self, url: str) -> HTTPRequestsConnectionClass | HTTPSRequestsConnectionClass | None:
906 cnx: HTTPRequestsConnectionClass | HTTPSRequestsConnectionClass | None = None

Callers 2

__customConnectionMethod · 0.95
testAssertUrlAllowedMethod · 0.80

Calls 1

__hostnameHasDomainMethod · 0.95

Tested by

no test coverage detected