Skip to content

Wrong behavior of URL validator for domain with 2 dashes #187

Closed

Description

@nitr0man

There is an error in URL validation when domain have two dashes. Domain validator passed such domains successfully.

In [1]: import validators                                                                                                                                                                                                                     

In [2]: validators.domain('foo-bar.com')                                                                                                                                                                                                      
Out[2]: True

In [3]: validators.domain('foo--bar.com')                                                                                                                                                                                                     
Out[3]: True

In [4]: validators.url('http://foo-bar.com')                                                                                                                                                                                                  
Out[4]: True

In [5]: validators.url('http://foo--bar.com')                                                                                                                                                                                                 
Out[5]: ValidationFailure(func=url, args={'value': 'http://foo--bar.com', 'public': False})

Activity

  1. added
    bug
    on Mar 2, 2023
  2. added
    duplicate
    outdated
    on Mar 14, 2023
  3. added a commit that references this issue on Mar 17, 2023
    c43826c
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

    bugduplicateoutdated

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions