From 8b6a1fbd9f0f2d4aa4ccabe135758701dc6f7cf8 Mon Sep 17 00:00:00 2001 From: Melissa Autumn Date: Mon, 16 Sep 2024 13:40:56 -0700 Subject: [PATCH] quote -> quote_plus --- backend/src/appointment/controller/auth.py | 6 +++--- backend/src/appointment/utils.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/backend/src/appointment/controller/auth.py b/backend/src/appointment/controller/auth.py index 243da0ebd..ead5a3f7a 100644 --- a/backend/src/appointment/controller/auth.py +++ b/backend/src/appointment/controller/auth.py @@ -48,7 +48,7 @@ def signed_url_by_subscriber(subscriber: schemas.Subscriber): if not short_url: short_url = base_url - url_safe_username = urllib.parse.quote(subscriber.username) + url_safe_username = urllib.parse.quote_plus(subscriber.username) # We sign with a different hash that the end-user doesn't have access to # We also need to use the default url, as short urls are currently setup as a redirect @@ -70,7 +70,7 @@ def schedule_links_by_subscriber(db, subscriber: models.Subscriber): if not short_url: short_url = base_url - url_safe_username = urllib.parse.quote(subscriber.username) + url_safe_username = urllib.parse.quote_plus(subscriber.username) # Empty space at join is for trailing slash! - return list(map(lambda sch: '/'.join([short_url, url_safe_username, urllib.parse.quote(sch.slug), '']), schedules)) + return list(map(lambda sch: '/'.join([short_url, url_safe_username, urllib.parse.quote_plus(sch.slug), '']), schedules)) diff --git a/backend/src/appointment/utils.py b/backend/src/appointment/utils.py index 64be81405..e48b70e6e 100644 --- a/backend/src/appointment/utils.py +++ b/backend/src/appointment/utils.py @@ -68,4 +68,4 @@ def retrieve_user_url_data(url): clean_url = f'{clean_url}/' # Return the username and signature decoded, but ensure the clean_url is encoded. - return urllib.parse.unquote(username), urllib.parse.unquote(signature), clean_url + return urllib.parse.unquote_plus(username), urllib.parse.unquote_plus(signature), clean_url