fix: read dashboard spa assets as utf-8

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
LeonSGP43
2026-06-14 02:31:04 -07:00
committed by Teknium
co-authored by Paperclip
parent 7b9dc7cd0a
commit 89bdb1e546
2 changed files with 41 additions and 2 deletions
+2 -2
View File
@@ -10656,7 +10656,7 @@ def mount_spa(application: FastAPI):
``__HERMES_AUTH_REQUIRED__`` flag lets the SPA pick the right
auth scheme for /api/pty and /api/ws (ticket vs token).
"""
html = _index_path.read_text()
html = _index_path.read_text(encoding="utf-8")
chat_js = "true" if _DASHBOARD_EMBEDDED_CHAT_ENABLED else "false"
gated = bool(getattr(app.state, "auth_required", False))
gated_js = "true" if gated else "false"
@@ -10706,7 +10706,7 @@ def mount_spa(application: FastAPI):
):
return JSONResponse({"error": "not found"}, status_code=404)
prefix = _normalise_prefix(request.headers.get("x-forwarded-prefix"))
css = css_path.read_text()
css = css_path.read_text(encoding="utf-8")
if prefix:
for asset_dir in ("/fonts/", "/fonts-terminal/", "/ds-assets/", "/assets/"):
css = css.replace(f"url({asset_dir}", f"url({prefix}{asset_dir}")