MCPcopy
hub / github.com/lightningpixel/modly / _resolve_input_path

Function _resolve_input_path

api/routers/optimize.py:49–62  ·  view source on GitHub ↗
(raw_path: str)

Source from the content-addressed store, hash-verified

47
48
49def _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")

Callers 3

optimize_meshFunction · 0.85
smooth_meshFunction · 0.85
transform_meshFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected