mirror of
https://github.com/home-assistant/frontend.git
synced 2026-08-23 06:37:55 +01:00
Pre-validate the credential on camera_proxy, camera_proxy_stream and image_proxy URLs before letting them hit core. Requests with a missing or "undefined" token, or with an authSig JWT whose exp has passed, are short-circuited to a synthetic 401 and never reach the server. This silences spurious "Login attempt or request with invalid authentication" warnings from homeassistant.components.http.ban that fire when the browser replays a stale <img src> after BFCache restore, tab resume, or a network change. The signed-path TTL is short (30s by default) and image elements happily hold onto the URL long after that. Limitations: service workers only run on secure contexts, so this does not help users on plain http LAN access. A core-side fix to ban.py that distinguishes expired-but-validly-signed paths from real login attempts remains the principled fix and covers all clients.