mirror of
https://github.com/tailscale/tailscale.git
synced 2024-11-29 04:55:31 +00:00
cmd/tailscale: modify empty hostname case
Signed-Off-By: Dmytro Shynkevych <dmytro@tailscale.com>
This commit is contained in:
parent
8163521c33
commit
65d2537c05
@ -80,12 +80,13 @@
|
||||
hostname string
|
||||
}
|
||||
|
||||
// validateHostname checks that name is a valid non-empty domain name label
|
||||
// validateHostname checks that name is a valid domain name label
|
||||
// pursuant to https://tools.ietf.org/html/rfc1034#section-3.1.
|
||||
func validateHostname(name string) error {
|
||||
switch {
|
||||
// Empty string is treated as missing hostname and replaced downstream.
|
||||
case len(name) == 0:
|
||||
return fmt.Errorf("empty")
|
||||
return nil
|
||||
case len(name) > 63:
|
||||
return fmt.Errorf("longer than 63 characters")
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user