Skip to content

Commit

Permalink
quote -> quote_plus
Browse files Browse the repository at this point in the history
  • Loading branch information
MelissaAutumn committed Sep 16, 2024
1 parent 2f803b8 commit 8b6a1fb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions backend/src/appointment/controller/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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))
2 changes: 1 addition & 1 deletion backend/src/appointment/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 8b6a1fb

Please sign in to comment.