mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
parent
1e31db47ab
commit
6e837e0c02
1 changed files with 9 additions and 1 deletions
|
@ -70,9 +70,17 @@ def http_requests_total() -> Callable[[Info], None]:
|
||||||
if not (scope.get("endpoint", None) and scope.get("router", None)):
|
if not (scope.get("endpoint", None) and scope.get("router", None)):
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
root_path = scope.get("root_path", "")
|
||||||
|
app = scope.get("app", {})
|
||||||
|
|
||||||
|
if hasattr(app, "root_path"):
|
||||||
|
app_root_path = getattr(app, "root_path")
|
||||||
|
if root_path.startswith(app_root_path):
|
||||||
|
root_path = root_path[len(app_root_path):]
|
||||||
|
|
||||||
base_scope = {
|
base_scope = {
|
||||||
"type": scope.get("type"),
|
"type": scope.get("type"),
|
||||||
"path": scope.get("root_path", "") + scope.get("path"),
|
"path": root_path + scope.get("path"),
|
||||||
"path_params": scope.get("path_params", {}),
|
"path_params": scope.get("path_params", {}),
|
||||||
"method": scope.get("method")
|
"method": scope.get("method")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue