MCPcopy
hub / github.com/mitmproxy/mitmproxy / path_components

Method path_components

mitmproxy/http.py:885–894  ·  view source on GitHub ↗

The URL's path components as a tuple of strings. Components are unquoted.

(self)

Source from the content-addressed store, hash-verified

883
884 @property
885 def path_components(self) -> tuple[str, ...]:
886 """
887 The URL's path components as a tuple of strings.
888 Components are unquoted.
889 """
890 path = urllib.parse.urlparse(self.url).path
891 # This needs to be a tuple so that it's immutable.
892 # Otherwise, this would fail silently:
893 # request.path_components.append("foo")
894 return tuple(url.unquote(i) for i in path.split("/") if i)
895
896 @path_components.setter
897 def path_components(self, components: Iterable[str]):

Callers

nothing calls this directly

Calls 4

unquoteMethod · 0.80
mapFunction · 0.50
splitMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected