FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

.onion TLD · Issue #401 · python-validators/validators · GitHub

Repository navigation

.onion TLD #401

Description

When validating URLs with TLD enabled, .onion comes up as not validated. Since .onion URLs (TOR) are kinda unique, I wonder if we should add it to the TLD list or add a separate flag.
I can open a PR for both solutions, I just wonder what the best way is.
For context, tldextract accepts .onion.

Activity

  1. nandgator commented on Sep 13, 2024

    Collaborator

    Hi @davidt99, are onion URLs validated by this library? Can you show me an example? AFAIK they are not in tests.

  2. davidt99 commented on Sep 13, 2024

    ContributorAuthor

    It's not validated when the consider_tld flag is on since .onion is not in the TLD list.

  3. nandgator commented on Sep 14, 2024

    Collaborator

    Okay, instead of adding it to _tld.txt, we could append it to _popular_cache in domain.py.

    _popular_cache = {"COM", "ORG", "RU", "DE", "NET", "BR", "UK", "JP", "FR", "IT"}
    _popular_cache.add("ONION")
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

    bugIssue: Works not as designed

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL