Skip to content

Why msn.comm validates? #67

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

Closed
lameei opened this issue Nov 6, 2017 · 3 comments · Fixed by #360
Closed

Why msn.comm validates? #67

lameei opened this issue Nov 6, 2017 · 3 comments · Fixed by #360
Labels
enhancement Issue/PR: A new feature outdated Issue/PR: Open for more than 3 months question Issue: A question

Comments

@lameei
Copy link

lameei commented Nov 6, 2017

I have the following code:

import validators

url = 'msn.comm'

if (validators.domain(url)) or (validators.url(url)):
    print("VALIDATION PASSED")
else:
    print("Please insert a domain name in this format: example.com")

And the msn.comm validates. Why is that?

@jbnance
Copy link

jbnance commented Dec 11, 2017

The validator merely checks that the subject is a valid domain syntactically - it does not have a list of valid TLDs nor does it attempt to resolve the domain. Syntactically 'msn.comm' is valid (as is 'fdsfds.fsaf.asfdsa.fdsa.fsdfsa.fsadfsa', for example).

@lameei
Copy link
Author

lameei commented Dec 12, 2017

This is weird. So what is the propose of validation here?

@jbnance
Copy link

jbnance commented Dec 12, 2017

It is validating the format just as many validators do (the email validator doesn't send an email to make sure the account exists). I would agree that it would be nice to have it check against a list of TLDs. Perhaps the maintainer could pull from here regularly:

https://data.iana.org/TLD/tlds-alpha-by-domain.txt

@yozachar yozachar added enhancement Issue/PR: A new feature question Issue: A question labels Mar 2, 2023
@yozachar yozachar added the outdated Issue/PR: Open for more than 3 months label Mar 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Issue/PR: A new feature outdated Issue/PR: Open for more than 3 months question Issue: A question
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants