tidy origin check docstring and auth update comment

This commit is contained in:
Josh Hawkins
2026-10-18 12:19:48 -05:00
parent 4fbde770d7
commit 0aa7cf9de9
2 changed files with 5 additions and 5 deletions
+4 -4
View File
@@ -483,10 +483,10 @@ def _hostname(value: str) -> str | None:
def ws_origin_allowed(environ: dict[str, Any]) -> bool:
"""Return True unless a browser opened the handshake from a foreign origin.
Browsers always send Origin on a WebSocket handshake and cannot add custom
headers to one, so a missing Origin means a non-browser client and a proxy
supplied X-Forwarded-Host cannot be forged by the page. Ports are ignored
because nginx forwards Host without one.
Browsers always send Origin on a WebSocket handshake, so a missing Origin
means a non-browser client. A page cannot add headers to a handshake, so
X-Forwarded-Host comes from a proxy. Ports are ignored because nginx
forwards Host without one.
"""
origin = environ.get("HTTP_ORIGIN")
if origin is None:
+1 -1
View File
@@ -194,7 +194,7 @@ class OutputProcess(FrigateProcess):
self.config.birdseye = birdseye_config
logger.debug("Applied dynamic birdseye config update")
# user changes publish None on this topic, role edits an AuthConfig
# user endpoints publish None on this topic and role edits an AuthConfig
_, auth_config = auth_config_subscriber.check_for_update()
if isinstance(auth_config, AuthConfig):