mirror of
https://github.com/wahyd4/home-docker.git
synced 2026-08-09 04:15:52 +10:00
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:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user