Skip to content

NVR with realtime local object detection for IP cameras

clean passwords when both rtsp and http present (#8399)

Blake Blacksheard1620b4e3954
diff --git a/frigate/util/builtin.py b/frigate/util/builtin.py
index 2a9b7053ab..376ea51cfe 100644
--- a/frigate/util/builtin.py
+++ b/frigate/util/builtin.py
@@ -114,10 +114,8 @@ def load_config_with_no_duplicates(raw_config) -> dict:
def clean_camera_user_pass(line: str) -> str:
"""Removes user and password from line."""
- if "rtsp://" in line:
- return re.sub(REGEX_RTSP_CAMERA_USER_PASS, "://*:*@", line)
- else:
- return re.sub(REGEX_HTTP_CAMERA_USER_PASS, "user=*&password=*", line)
+ rtsp_cleaned = re.sub(REGEX_RTSP_CAMERA_USER_PASS, "://*:*@", line)
+ return re.sub(REGEX_HTTP_CAMERA_USER_PASS, "user=*&password=*", rtsp_cleaned)
def escape_special_characters(path: str) -> str: