summaryrefslogtreecommitdiff
path: root/internal
diff options
context:
space:
mode:
authortjpcc <tjp@ctrl-c.club>2023-05-03 21:13:31 -0600
committertjpcc <tjp@ctrl-c.club>2023-05-03 21:13:31 -0600
commit11b693e72fc5f141f4d38307a4c49829f8059a8e (patch)
tree121c2d2dc7e61dc681c463b00a5d4c4a2cb60d8f /internal
parent91218665d27e39ccf799fdd4c6f7c8bb8e4ca4cf (diff)
now we should allow empty address
Diffstat (limited to 'internal')
-rw-r--r--internal/server.go2
1 files changed, 1 insertions, 1 deletions
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 ":<port>" 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