You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've found that checking a URL with an uppercase scheme name with the is_url checker results in a "False" result.
Desired Behaviour
RFC-3986 specifies that the scheme portion of a URL should be case-insensitive:
Scheme names consist of a sequence of characters beginning with a
letter and followed by any combination of letters, digits, plus
("+"), period ("."), or hyphen ("-"). Although schemes are case-
insensitive, the canonical form is lowercase and documents that
specify schemes must do so with lowercase letters. An implementation
should accept uppercase letters as equivalent to lowercase in scheme
names (e.g., allow "HTTP" as well as "http") for the sake of
robustness but should only produce lowercase scheme names for
consistency.
I believe that the checker should return "True" if an uppercase scheme is provided, even if the validator wants to coerce it to lowercase later. I'd be interested to hear your thoughts 😄
Demonstration
$ pip3 freeze | grep validator-collection
validator-collection==1.4.2
$ python3
Python 3.7.7 (default, Jun 29 2020, 14:21:56)
[Clang 11.0.3 (clang-1103.0.32.59)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from validator_collection import checkers
>>> url = "https://www.google.com"
>>> checkers.is_url(url)
True
>>> url = "HTTPS://www.google.com"
>>> checkers.is_url(url)
False
What?
I've found that checking a URL with an uppercase scheme name with the
is_url
checker results in a "False" result.Desired Behaviour
RFC-3986 specifies that the scheme portion of a URL should be case-insensitive:
I believe that the checker should return "True" if an uppercase scheme is provided, even if the validator wants to coerce it to lowercase later. I'd be interested to hear your thoughts 😄
Demonstration
The desired behaviour would be:
The text was updated successfully, but these errors were encountered: