agnes-the-ai-analyst/app/web
Vojtech Rysanek 58001af27d fix(web): address PR #372 review — meta charset ordering + enabled coercion
Two issues raised by @minasarustamyan:

1. head_start loop rendered BEFORE <meta charset="UTF-8"> in both
   base.html and base_login.html. HTML5 requires the charset declaration
   within the first 1024 bytes; a long operator-injected snippet could
   push it past that window, dropping browsers into locale-default
   encoding (historically a UTF-7 charset-confusion XSS vector). Move
   the head_start loop after charset + viewport meta tags — vendor
   hooks (GTM dataLayer init, etc.) still install before any CSS/JS, the
   two required meta tags just come first.

2. `entry.get("enabled") is False` matched only the Python False
   singleton — `enabled: "false"` (quoted YAML string), `enabled: 0`,
   `enabled: "no"` etc. all slipped through (bool("false") == True in
   Python). For what is meant to be a kill switch on admin-injected JS,
   an operator who fat-fingers the quoting would silently leave the
   snippet live. Add `_custom_script_enabled()` coercion helper that
   honours quoted booleans, numeric 0, and the usual `no`/`off`/`""`
   variants. Default-on for missing / None to preserve the
   default-enabled field semantics.

13 new parametrized tests cover every YAML truthy-shape the operator
might paste. Render test now asserts head_start lands after both
required <meta> tags.
2026-05-21 13:59:11 +04:00
..
static feat(web): /home value-first redesign + unified page-shell across app (#366) 2026-05-21 06:19:16 +00:00
templates fix(web): address PR #372 review — meta charset ordering + enabled coercion 2026-05-21 13:59:11 +04:00
__init__.py feat: add FastAPI server with auth, RBAC, and all API endpoints 2026-03-27 15:19:18 +01:00
connector_prompts.py feat(setup): configurable instance brand + connector setup overhaul (#268) 2026-05-12 17:10:08 +02:00
router.py feat(web): instance.custom_scripts — operator-injected HTML/JS into base.html 2026-05-21 13:22:27 +04:00
setup_instructions.py feat(web): /home value-first redesign + unified page-shell across app (#366) 2026-05-21 06:19:16 +00:00