MCPcopy
hub / github.com/encode/httpx / matches

Method matches

httpx/_utils.py:192–203  ·  view source on GitHub ↗
(self, other: URL)

Source from the content-addressed store, hash-verified

190 self.host_regex = re.compile(f"^{domain}$")
191
192 def matches(self, other: URL) -> bool:
193 if self.scheme and self.scheme != other.scheme:
194 return False
195 if (
196 self.host
197 and self.host_regex is not None
198 and not self.host_regex.match(other.host)
199 ):
200 return False
201 if self.port is not None and self.port != other.port:
202 return False
203 return True
204
205 @property
206 def priority(self) -> tuple[int, int, int]:

Callers 3

test_url_matchesFunction · 0.95
_transport_for_urlMethod · 0.80
_transport_for_urlMethod · 0.80

Calls

no outgoing calls

Tested by 1

test_url_matchesFunction · 0.76