MCPcopy
hub / github.com/encode/starlette / get_path

Method get_path

starlette/staticfiles.py:101–107  ·  view source on GitHub ↗

Given the ASGI scope, return the `path` string to serve up, with OS specific path separators, and any '..', '.' components removed.

(self, scope: Scope)

Source from the content-addressed store, hash-verified

99 await response(scope, receive, send)
100
101 def get_path(self, scope: Scope) -> str:
102 """
103 Given the ASGI scope, return the `path` string to serve up,
104 with OS specific path separators, and any '..', '.' components removed.
105 """
106 route_path = get_route_path(scope)
107 return os.path.normpath(os.path.join(*route_path.split("/")))
108
109 async def get_response(self, path: str, scope: Scope) -> Response:
110 """

Calls 1

get_route_pathFunction · 0.90