diff options
author | tjpcc <tjp@ctrl-c.club> | 2023-05-03 12:22:27 -0600 |
---|---|---|
committer | tjpcc <tjp@ctrl-c.club> | 2023-05-03 12:22:27 -0600 |
commit | def2baade5a4af58e3444cf6c923b1e4de584329 (patch) | |
tree | a07811cc1aa87be328b5a118fe024f9999ddfb1e /gemini | |
parent | c7f8a1292544c8981eb1c35394d5b50100fe1790 (diff) |
add JoinDefaultPort for servers' configuration
Diffstat (limited to 'gemini')
-rw-r--r-- | gemini/serve.go | 5 |
1 files changed, 2 insertions, 3 deletions
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 { |