This commit is contained in:
Akshat Sinha 2026-05-27 22:06:29 -05:00 committed by GitHub
commit 23461e3de6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -9,7 +9,8 @@ def is_uri(value, schemes=None):
""" Will verify that the string passed is a valid 'URI', if given a list of valid schemes it will match those """
try:
x = urlparse(value)
isit = all([x.scheme is not None, x.path is not None, not schemes or x.scheme in schemes])
# urlparse returns empty string for scheme when not present, not None
isit = all([x.scheme, x.path is not None, not schemes or x.scheme in schemes])
except Exception as e:
isit = False
return isit