fix(demo-service): render HTML inline instead of download

- FileResponse sets Content-Disposition: attachment by default
- Switch to HTMLResponse for .html files to render in browser
This commit is contained in:
Junv (via Hermes)
2026-06-14 11:45:34 +10:00
parent c76e3f86a8
commit cc0fe77749
+3
View File
@@ -164,6 +164,9 @@ async def site_content(path: str = "", request: Request = None):
target = target / "index.html"
if not target.exists():
return HTMLResponse(AUTH_REQUIRED_HTML, status_code=404)
# HTML files render inline; others (CSS, JS, images) are served as files
if target.suffix == ".html":
return HTMLResponse(target.read_text())
return FileResponse(target)
@app.get("/api/sites")