demo-service: add Cache-Control no-store to HTML content responses

Prevents browser from caching old responses that had wrong
Content-Disposition header before the .draft/.bak fix.
This commit is contained in:
Junv (via Hermes)
2026-07-13 10:37:43 +10:00
parent f2d7c53778
commit dd7528e437
+3 -1
View File
@@ -216,7 +216,9 @@ async def site_content(path: str = "", request: Request = None):
return error_resp(404)
# HTML files render inline; others (CSS, JS, images) served as files
if target.suffix == ".html" or target.suffix in (".draft", ".bak"):
return HTMLResponse(target.read_text())
resp = HTMLResponse(target.read_text())
resp.headers["Cache-Control"] = "no-store"
return resp
resp = FileResponse(target)
resp.headers["Content-Disposition"] = "inline"
return resp