summaryrefslogtreecommitdiff
path: root/spartan/serve.go
diff options
context:
space:
mode:
Diffstat (limited to 'spartan/serve.go')
-rw-r--r--spartan/serve.go6
1 files changed, 2 insertions, 4 deletions
diff --git a/spartan/serve.go b/spartan/serve.go
index 61199b1..a477a45 100644
--- a/spartan/serve.go
+++ b/spartan/serve.go
@@ -7,7 +7,6 @@ import (
"fmt"
"io"
"net"
- "strings"
sr "tildegit.org/tjp/sliderule"
"tildegit.org/tjp/sliderule/internal"
@@ -32,9 +31,8 @@ func NewServer(
) (sr.Server, error) {
ss := &spartanServer{handler: handler}
- if strings.IndexByte(hostname, ':') < 0 {
- hostname = net.JoinHostPort(hostname, "300")
- }
+ hostname = internal.JoinDefaultPort(hostname, "300")
+ address = internal.JoinDefaultPort(address, "300")
var err error
ss.Server, err = internal.NewServer(ctx, hostname, network, address, errLog, ss.handleConn)