summaryrefslogtreecommitdiff
path: root/gemini/serve.go
diff options
context:
space:
mode:
authortjpcc <tjp@ctrl-c.club>2023-05-03 12:22:27 -0600
committertjpcc <tjp@ctrl-c.club>2023-05-03 12:22:27 -0600
commitdef2baade5a4af58e3444cf6c923b1e4de584329 (patch)
treea07811cc1aa87be328b5a118fe024f9999ddfb1e /gemini/serve.go
parentc7f8a1292544c8981eb1c35394d5b50100fe1790 (diff)
add JoinDefaultPort for servers' configuration
Diffstat (limited to 'gemini/serve.go')
-rw-r--r--gemini/serve.go5
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 {