We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 95e4276 commit 0a19fb5Copy full SHA for 0a19fb5
src/idom/backend/utils.py
@@ -60,10 +60,10 @@ def run(
60
61
def safe_client_build_dir_path(path: str) -> Path:
62
"""Prevent path traversal out of :data:`CLIENT_BUILD_DIR`"""
63
- if path in ("", "/"):
64
- return CLIENT_BUILD_DIR / "index.html"
65
- else:
66
- return traversal_safe_path(CLIENT_BUILD_DIR, *path.split("/"))
+ return traversal_safe_path(
+ CLIENT_BUILD_DIR,
+ *("index.html" if path in ("", "/") else path).split("/"),
+ )
67
68
69
def safe_web_modules_dir_path(path: str) -> Path:
0 commit comments