Skip to content

Why msn.comm validates? #67

Closed
Closed

Description

@lameei

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?

Activity

  1. jbnance commented on Dec 11, 2017

    @jbnance

    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).

  2. lameei commented on Dec 12, 2017

    @lameei
    Author

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

  3. jbnance commented on Dec 12, 2017

    @jbnance

    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

  4. added
    enhancementIssue/PR: A new feature
    questionIssue: A question
    outdatedIssue/PR: Open for more than 3 months
    on Mar 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementIssue/PR: A new featureoutdatedIssue/PR: Open for more than 3 monthsquestionIssue: A question

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions