(raw_path: str)
| 47 | |
| 48 | |
| 49 | def _resolve_input_path(raw_path: str) -> Path: |
| 50 | candidate = Path(raw_path) |
| 51 | if candidate.is_absolute(): |
| 52 | resolved = candidate.resolve() |
| 53 | if not resolved.exists(): |
| 54 | raise HTTPException(404, f"File not found: {raw_path}") |
| 55 | return resolved |
| 56 | |
| 57 | resolved = (WORKSPACE_DIR / raw_path).resolve() |
| 58 | if not str(resolved).startswith(str(WORKSPACE_DIR.resolve())): |
| 59 | raise HTTPException(400, "Invalid path") |
| 60 | if not resolved.exists(): |
| 61 | raise HTTPException(404, f"File not found: {raw_path}") |
| 62 | return resolved |
| 63 | |
| 64 | |
| 65 | @router.post("/mesh") |
no outgoing calls
no test coverage detected