diff --git a/src/validators/domain.py b/src/validators/domain.py index 23ae263..384ade0 100644 --- a/src/validators/domain.py +++ b/src/validators/domain.py @@ -16,6 +16,7 @@ class _IanaTLD: _full_cache: Optional[Set[str]] = None # source: https://www.statista.com/statistics/265677 _popular_cache = {"COM", "ORG", "RU", "DE", "NET", "BR", "UK", "JP", "FR", "IT"} + _popular_cache.add("ONION") @classmethod def _retrieve(cls): diff --git a/tests/test_domain.py b/tests/test_domain.py index 6d8e867..63342f7 100644 --- a/tests/test_domain.py +++ b/tests/test_domain.py @@ -46,6 +46,7 @@ def test_returns_true_on_valid_domain(value: str, rfc_1034: bool, rfc_2782: bool ("_example.com", True, False, True), ("example_.com", True, False, True), ("somerandomexample.xn--fiqs8s", True, False, False), + ("somerandomexample.onion", True, False, False), ], ) def test_returns_true_on_valid_top_level_domain(