Skip to content

fix(fqdn): allow hyphens in last domain label#1548

Open
alihasan070707 wants to merge 1 commit intogo-playground:masterfrom
alihasan070707:fix/fqdn-hyphen-labels
Open

fix(fqdn): allow hyphens in last domain label#1548
alihasan070707 wants to merge 1 commit intogo-playground:masterfrom
alihasan070707:fix/fqdn-hyphen-labels

Conversation

@alihasan070707
Copy link

Fixes Or Enhances

Summary

The fqdn validator was rejecting valid domain names that contain hyphens in the last label (e.g. test-site-http.test-site), because the TLD character class [a-zA-Z0-9] did not include -.

Change

One character added to the last label's character class in fqdnRegexStringRFC1123:

No other parts of the regex were modified.

Test

Added regression case to TestFQDNValidation:

  • test-site-http.test-site → valid

@go-playground/validator-maintainers

@alihasan070707 alihasan070707 requested a review from a team as a code owner March 20, 2026 02:24
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.

1 participant