Commit 2fe624f3 authored by David Read's avatar David Read
Browse files

Allow uppercase schemes in URLs.

parent 52fdd246
...@@ -557,8 +557,9 @@ def tidy_url(url): ...@@ -557,8 +557,9 @@ def tidy_url(url):
except urllib3.exceptions.LocationParseError, e: except urllib3.exceptions.LocationParseError, e:
raise LinkInvalidError('URL parsing failure: %s' % e) raise LinkInvalidError('URL parsing failure: %s' % e)
# Check we aren't using any schemes we shouldn't be # Check we aren't using any schemes we shouldn't be.
if not parsed_url.scheme in ALLOWED_SCHEMES: # Scheme is case-insensitive.
if not parsed_url.scheme.lower() in ALLOWED_SCHEMES:
raise LinkInvalidError('Invalid url scheme. Please use one of: %s' % raise LinkInvalidError('Invalid url scheme. Please use one of: %s' %
' '.join(ALLOWED_SCHEMES)) ' '.join(ALLOWED_SCHEMES))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment