From 76f6f8031847c8c373bb2df0ac217834a4acbede Mon Sep 17 00:00:00 2001 From: Ben Toogood Date: Tue, 7 Apr 2020 11:23:21 +0100 Subject: [PATCH] Default to Hostname --- api/server/auth/auth.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/server/auth/auth.go b/api/server/auth/auth.go index 43c3a888..0faf1447 100644 --- a/api/server/auth/auth.go +++ b/api/server/auth/auth.go @@ -140,7 +140,7 @@ func (h authHandler) NamespaceFromRequest(req *http.Request) string { } // determine the host, e.g. dev.micro.mu:8080 - var host string + host := req.URL.Hostname() if h, _, err := net.SplitHostPort(req.Host); err == nil { host = h // host does contain a port } else if strings.Contains(err.Error(), "missing port in address") {