MCPcopy
hub / github.com/scrapy/scrapy / check_request_url

Method check_request_url

scrapy/core/http2/stream.py:199–207  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

197 return self._deferred_response
198
199 def check_request_url(self) -> bool:
200 # Make sure that we are sending the request to the correct URL
201 url = urlparse_cached(self._request)
202 return (
203 url.netloc == str(self._protocol.metadata["uri"].host, "utf-8")
204 or url.netloc == str(self._protocol.metadata["uri"].netloc, "utf-8")
205 or url.netloc
206 == f"{self._protocol.metadata['ip_address']}:{self._protocol.metadata['uri'].port}"
207 )
208
209 def _get_request_headers(self) -> list[tuple[str, str]]:
210 url = urlparse_cached(self._request)

Callers 1

initiate_requestMethod · 0.95

Calls 1

urlparse_cachedFunction · 0.90

Tested by

no test coverage detected