matrix-builder / services /api /app /utils /zip_utils.py
ruslanmv
Deploy: metrics + docs (Batch 12)
22b729d
Raw
History Blame Contribute Delete
215 Bytes
from pathlib import Path
def safe_zip_path(path: str) -> Path:
candidate = Path(path)
if candidate.is_absolute() or ".." in candidate.parts:
raise ValueError("unsafe zip path")
return candidate