From 0a74228cf9e1366537189e387cc0b119fcc1fa78 Mon Sep 17 00:00:00 2001 From: Blake Blackshear Date: Tue, 31 Oct 2023 07:35:23 -0500 Subject: [PATCH] clean passwords when both rtsp and http present --- frigate/util/builtin.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/frigate/util/builtin.py b/frigate/util/builtin.py index 2a9b7053a..376ea51cf 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: