diff --git a/r2/r2/lib/utils/utils.py b/r2/r2/lib/utils/utils.py index 282a283e5..96d9d81de 100644 --- a/r2/r2/lib/utils/utils.py +++ b/r2/r2/lib/utils/utils.py @@ -314,6 +314,9 @@ def sanitize_url(url, require_scheme = False): False' is set, the url is returned with scheme 'http', provided it otherwise validates""" + if not url: + return + url = url.strip() if url.lower() == 'self': return url