From def2baade5a4af58e3444cf6c923b1e4de584329 Mon Sep 17 00:00:00 2001 From: tjpcc Date: Wed, 3 May 2023 12:22:27 -0600 Subject: add JoinDefaultPort for servers' configuration --- gemini/serve.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'gemini/serve.go') diff --git a/gemini/serve.go b/gemini/serve.go index 01e186f..a439ce0 100644 --- a/gemini/serve.go +++ b/gemini/serve.go @@ -38,9 +38,8 @@ func NewServer( ) (sr.Server, error) { s := &server{handler: handler} - if strings.IndexByte(hostname, ':') < 0 { - hostname = net.JoinHostPort(hostname, "1965") - } + hostname = internal.JoinDefaultPort(hostname, "1965") + address = internal.JoinDefaultPort(address, "1965") internalServer, err := internal.NewServer(ctx, hostname, network, address, errorLog, s.handleConn) if err != nil { -- cgit v1.2.3