new changes
This commit is contained in:
@@ -13,7 +13,7 @@ router = APIRouter(prefix="/logs", tags=["logs"])
|
||||
def _resolve_log_path(path: str) -> str:
|
||||
"""Resolve path within www_logs only"""
|
||||
if ".." in path:
|
||||
raise HTTPException(status_code=401, detail="Path traversal not allowed")
|
||||
raise HTTPException(status_code=400, detail="Path traversal not allowed")
|
||||
cfg = get_runtime_config()
|
||||
logs_root = os.path.abspath(cfg["www_logs"])
|
||||
path = path.strip().replace("\\", "/").lstrip("/")
|
||||
|
||||
Reference in New Issue
Block a user