Skip to content

Commit

Permalink
Remove trailing slashes
Browse files Browse the repository at this point in the history
  • Loading branch information
djamg committed Oct 18, 2023
1 parent 689b717 commit 2a6aebc
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions funnel/views/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,8 @@ def validate_is_app_url(url: str | furl, method: str = 'GET') -> bool:
"""Confirm if an external URL is served by the current app (runtime-only)."""
# Parse or copy URL and remove username and password before further analysis
parsed_url = furl(url).remove(username=True, password=True)
path = parsed_url.pathstr.strip('/')
parsed_url.set(path=path)
if not parsed_url.host or not parsed_url.scheme:
return False # This validator requires a full URL

Expand Down

0 comments on commit 2a6aebc

Please sign in to comment.