MCPcopy
hub / github.com/psf/requests / get_full_url

Method get_full_url

src/requests/cookies.py:60–78  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

58 return self.get_host()
59
60 def get_full_url(self) -> str:
61 # Only return the response's URL if the user hadn't set the Host
62 # header
63 if not self._r.headers.get("Host"):
64 return self._r.url
65 # If they did set it, retrieve it and reconstruct the expected domain
66 host = to_native_string(self._r.headers["Host"], encoding="utf-8")
67 parsed = urlparse(self._r.url)
68 # Reconstruct the URL as we expect it
69 return urlunparse(
70 [
71 parsed.scheme,
72 host,
73 parsed.path,
74 parsed.params,
75 parsed.query,
76 parsed.fragment,
77 ]
78 )
79
80 def is_unverifiable(self) -> bool:
81 return True

Callers

nothing calls this directly

Calls 2

to_native_stringFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected