-
Notifications
You must be signed in to change notification settings - Fork 162
Localhost no longer recognized #312
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi @23pointsNorth, please refer #285 (comment) |
Right, thanks for pointing it out. I remember the documentation noted that it was introduced as of 0.11.x as a new feature. A problem with the suggested solution is that
which is not a valid " |
It is true, that In a (W)LAN, I could have my hosts named as Currently URL validation accepts all of these parameters: def url(
value: str,
/,
*,
skip_ipv6_addr: bool = False,
skip_ipv4_addr: bool = False,
may_have_port: bool = True,
simple_host: bool = False,
strict_query: bool = True,
rfc_1034: bool = False,
rfc_2782: bool = False,
): It is possible to add another boolean parameter say
Instead, if an user want to ensure that an URL is strictly from validators import url as is_valid_url
from urllib.parse import urlsplit
if is_valid_url(given_url, simple_host=False) and urlsplit(given_url).netloc == 'localhost' :
# do something |
Thanks, I understand the perspective, just assumed some stability of the API. Happy for you to close the issues as resolved. |
Thanks for using |
Uh oh!
There was an error while loading. Please reload this page.
Setup:
python3 -m pip install --upgrade validators==0.22.0
Code to reproduce:
Expected outcome:
Both calls to return true.
Similar to the other issue, this commit c43826c seems to comment the tests for
localhost
The text was updated successfully, but these errors were encountered: