Files
Matt Godbolt 13358939ce Drive env branding from extraBodyClass alone (#8755)
The favicon selector and logo overlay used to be hard-coded switches
over the env name array (favicon) and a chained if/else in logo.pug.
Adding a new environment meant editing both, the favicon allowlist, and
the tests.

Convert both to a convention driven by extraBodyClass:
favicon-<class>.ico and site-logo-<class>.svg. logo.pug becomes one
unconditional overlay tag. getFaviconFilename takes the class string
directly.

Add validateBrandingAssets, called once during setupWebServer, which
throws if the configured assets are missing. Typos in extraBodyClass now
fail at startup with a clear error rather than serving a broken favicon.

isFaviconRequest becomes a regex matching favicon-*.ico so the log
filter no longer needs a per-env list (and previously didn't match
because req.path has a leading slash).

A new environment is now: drop two files in public/, set extraBodyClass
in the env properties file. No TS or pug changes.

---------

Co-authored-by: Matt Godbolt <mattgodbolt@hudson-trading.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-07-14 17:18:25 +01:00
..