INNER CODE UNIT · Python
full
GenielabsOpenSource/spine-animation-ai · reskin-app/app/backend/server.py:190
full = (project.path / rel).resolve()
if not str(full).startswith(str(project.path.resolve())):
raise HTTPException(403, "path escapes project root")
if not full.is_file():
raise HTTPException(404, str(full))
if v and full.suffix.lower() == ".atlas":
text = full.read_text()
out_lines = []
rewrote = False
for line in text.split("\n"):
stripped = line.strip()
if (not rewrote) and stripped and stripped.lower().endswith(
(".png", ".jpg", ".jpeg", ".webp")
) and "?" not in stripped:
out_lines.append(f"{stripped}?v={v}")
rewrote = True
else:
out_lines.append(line)