mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-10-19 13:12:48 +03:00
tidy origin check docstring and auth update comment
This commit is contained in:
+4
-4
@@ -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:
|
||||
|
||||
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user