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

Reject an underscore in the last domain label by SashaMIT · Pull Request #485 · python-validators/validators · GitHub

Repository navigation

Reject an underscore in the last domain label - #485

Open
SashaMIT wants to merge 1 commit into
python-validators:masterfrom
SashaMIT:tld-underscore
Open

SashaMIT wants to merge 1 commit into
python-validators:masterfrom
SashaMIT:tld-underscore

Conversation

SashaMIT commented Oct 1, 2026 •
edited
Loading

Copy link
Copy Markdown

domain("foo.ba_r") returned True, and domain("example.co_uk") did too. hostname("foo.ba_r") and email("a@foo.ba_r") did too.

An underscore is allowed in a service label when rfc_2782 is set. example_.com and _sip._tcp.example.com still need that flag, and they still pass with it. The last label allowed _ either way. example.com, xn----gtbspbbmkef.xn--p1ai, and a.co still pass.

Fixes #484.

Test plan

  • pytest tests/test_domain.py tests/test_hostname.py tests/test_email.py (119 passed)

The last label allowed "_" with or without rfc_2782, so foo.ba_r validated.

This branch has not been deployed

No deployments
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

An underscore in the last domain label is accepted

1 participant


Back | FazBrowse Home | New Git URL