We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a81e596 commit 2ce1870Copy full SHA for 2ce1870
hardware/memory/cartridge/plusrom/addrinfo.go
@@ -60,11 +60,18 @@ func isHostValid(host string) bool {
60
if len(l) < 1 || len(l) > 63 {
61
return false
62
}
63
+
64
+ // check for valid characters: letters (upper/lower), digits or hyphen
65
for _, c := range l {
- if !unicode.IsLetter(c) && !unicode.IsDigit(c) {
66
+ if !unicode.IsLetter(c) && !unicode.IsDigit(c) && c != '-' {
67
68
69
70
71
+ // a hostname may not start with a hyphen
72
+ if l[0] == '-' {
73
+ return false
74
+ }
75
76
77
return true
0 commit comments