Skip to content

not working for some urls #213

Closed

Description

@deepcode-debug

Hey guys, thanks a lot for the work! really appreciate it.

However it is failing for some urls like 'www.intesasanpaolo.com'
Can you guys please check?

Activity

  1. Wombatpm commented on Aug 15, 2022

    @Wombatpm

    I hit the same issue and am working on a pull request. The problem is that the validator is expecting a protocol such as http:// or https:// or ftp://. Now I was taught long ago that a url required a protocol, but that was back in the day when browsers handled ftp, gopher, telnet, and others. Now a url is just assumed to be a web address and browser will put http or https automatically. Even the MDN documentation says it is optional.

    You don't need to include the protocol (the browser uses HTTP by default) or the port (which is only required when the targeted Web server is using some unusual port), but all the other parts of the URL are necessary.May 15, 2022

    [[What is a URL? - Learn web development | ](https://developer.mozilla.org/en-US/docs/Learn/Common_questions/What_is_a_URL#:~:text=You%20don't%20need%20to%20include%20the%20protocol%20(the%20browser,of%20the%20URL%20are%20necessary.)

    In validators/url.py. line 10 needs to be changed to capture 0 or 1 of the protocol identifier

        # protocol identifier
        r"(?:(?:https?|ftp)://)?"
    
  2. Wombatpm commented on Aug 18, 2022

    @Wombatpm

    I ended up creating a new validator called website. It is designed to work with inputs that may be coming from a marketing type organization where the concepts of URL, WEBSITE, INTERNETADDRESS get all bumbled togther. Its basically the same as the url validator, but the protocols have been limited to http and https. and the whole need for a protocol (http://) portion is option. http://home.netscape.com and home.netscape.com are now both valid websites, but the later will fail the url validator.

    You can see my changes and pull request here #214

  3. added
    invalidIssue/PR: ¯\_(ツ)_/¯
    outdatedIssue/PR: Open for more than 3 months
    on Mar 14, 2023
  4. 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

    invalidIssue/PR: ¯\_(ツ)_/¯outdatedIssue/PR: Open for more than 3 months

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions