Only allow * and ? as entire DNS name labels
This commit is contained in:
parent
2c9df274e9
commit
ec68dde647
|
@ -73,10 +73,12 @@ func isValidDNSLabelChar (ch rune) bool {
|
||||||
return (ch >= 'A' && ch <= 'Z') ||
|
return (ch >= 'A' && ch <= 'Z') ||
|
||||||
(ch >= 'a' && ch <= 'z') ||
|
(ch >= 'a' && ch <= 'z') ||
|
||||||
(ch >= '0' && ch <= '9') ||
|
(ch >= '0' && ch <= '9') ||
|
||||||
ch == '-' || ch == '_' ||
|
ch == '-' || ch == '_';
|
||||||
ch == '*' || ch == '?';
|
|
||||||
}
|
}
|
||||||
func isValidDNSLabel (label string) bool {
|
func isValidDNSLabel (label string) bool {
|
||||||
|
if label == "*" || label == "?" {
|
||||||
|
return true
|
||||||
|
}
|
||||||
for _, ch := range label {
|
for _, ch := range label {
|
||||||
if !isValidDNSLabelChar(ch) {
|
if !isValidDNSLabelChar(ch) {
|
||||||
return false
|
return false
|
||||||
|
|
Loading…
Reference in New Issue