From 65d2537c05e976c3436d0b8f6a197e6d9f092488 Mon Sep 17 00:00:00 2001 From: Dmytro Shynkevych Date: Wed, 15 Jul 2020 17:22:13 -0400 Subject: [PATCH] cmd/tailscale: modify empty hostname case Signed-Off-By: Dmytro Shynkevych --- cmd/tailscale/cli/up.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cmd/tailscale/cli/up.go b/cmd/tailscale/cli/up.go index 6505d13dc..244d724b2 100644 --- a/cmd/tailscale/cli/up.go +++ b/cmd/tailscale/cli/up.go @@ -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") }