From 11b693e72fc5f141f4d38307a4c49829f8059a8e Mon Sep 17 00:00:00 2001 From: tjpcc Date: Wed, 3 May 2023 21:13:31 -0600 Subject: now we should allow empty address --- internal/server.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'internal/server.go') diff --git a/internal/server.go b/internal/server.go index e3fbfb2..f2b3485 100644 --- a/internal/server.go +++ b/internal/server.go @@ -130,7 +130,7 @@ func (s *Server) propagateClose() { // JoinDefaultPort appends ":" iff the address does not already contain a port. func JoinDefaultPort(address string, port string) string { - if address[0] == '[' { + if len(address) > 0 && address[0] == '[' { hend := strings.LastIndexByte(address, ']') if len(address) > hend+1 && address[hend+1] == ':' { return address -- cgit v1.2.3