Commit bd0b2470 authored by Darren Shepherd's avatar Darren Shepherd

only use the resolved name if port was zero

parent 2fede21a
...@@ -240,8 +240,10 @@ func (s *server) Start(stayUp bool) error { ...@@ -240,8 +240,10 @@ func (s *server) Start(stayUp bool) error {
if err != nil { if err != nil {
return err return err
} }
if _, port, err := net.SplitHostPort(s.config.Addr); err != nil || port == "0" {
// Use the actual address as baseURL host. This handles the "0" port case. // Use the actual address as baseURL host. This handles the "0" port case.
s.config.BaseURL.Host = listener.Addr().String() s.config.BaseURL.Host = listener.Addr().String()
}
if s.config.TLSConfig != nil { if s.config.TLSConfig != nil {
return s.server.ServeTLS(listener, "", "") // Use certs from TLSConfig. return s.server.ServeTLS(listener, "", "") // Use certs from TLSConfig.
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment