From 672f5cc5ce8853334e8baf755dbac386e8284c71 Mon Sep 17 00:00:00 2001 From: rkuo-danswer Date: Tue, 8 Oct 2024 13:46:11 -0700 Subject: [PATCH] urlencode the password part properly before putting it in the broker url (#2719) Co-authored-by: Richard Kuo --- backend/danswer/background/celery/celeryconfig.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/backend/danswer/background/celery/celeryconfig.py b/backend/danswer/background/celery/celeryconfig.py index 1b1aa092d171..31d36d99533e 100644 --- a/backend/danswer/background/celery/celeryconfig.py +++ b/backend/danswer/background/celery/celeryconfig.py @@ -1,4 +1,6 @@ # docs: https://docs.celeryq.dev/en/stable/userguide/configuration.html +import urllib.parse + from danswer.configs.app_configs import CELERY_BROKER_POOL_LIMIT from danswer.configs.app_configs import CELERY_RESULT_EXPIRES from danswer.configs.app_configs import REDIS_DB_NUMBER_CELERY @@ -17,7 +19,7 @@ CELERY_SEPARATOR = ":" CELERY_PASSWORD_PART = "" if REDIS_PASSWORD: - CELERY_PASSWORD_PART = f":{REDIS_PASSWORD}@" + CELERY_PASSWORD_PART = ":" + urllib.parse.quote(REDIS_PASSWORD, safe="") + "@" REDIS_SCHEME = "redis"