Commit b9258bd
authored
fix(fqdn): allow hyphens in last domain label (#1548)
## 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](cci:1://file:///Users/admin/validator/validator_test.go:10628:0-10676:1):
- `test-site-http.test-site` → valid
@go-playground/validator-maintainers1 parent b9f1d79 commit b9258bd
2 files changed
+2
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | | - | |
| 61 | + | |
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10643 | 10643 | | |
10644 | 10644 | | |
10645 | 10645 | | |
| 10646 | + | |
10646 | 10647 | | |
10647 | 10648 | | |
10648 | 10649 | | |
| |||
0 commit comments