This commit is contained in:
jdl
2026-06-10 18:52:11 +02:00
parent bb28b8f340
commit db78964033
13 changed files with 373 additions and 62 deletions

View File

@@ -95,6 +95,9 @@ func Peer_Validate(p *Peer) error {
return ErrInvalidPort
}
if len(p.Name) == 0 {
return ErrInvalidPeerName
}
for _, c := range p.Name {
if c >= 'a' && c <= 'z' {
continue
@@ -102,7 +105,7 @@ func Peer_Validate(p *Peer) error {
if c >= '0' && c <= '9' {
continue
}
if c == '.' || c == '-' || c == '_' {
if c == '-' {
continue
}
return ErrInvalidPeerName