Tweak
This commit is contained in:
parent
76f6f80318
commit
05ac3ff274
@ -141,11 +141,13 @@ func (h authHandler) NamespaceFromRequest(req *http.Request) string {
|
||||
|
||||
// determine the host, e.g. dev.micro.mu:8080
|
||||
host := req.URL.Hostname()
|
||||
if len(host) == 0 {
|
||||
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") {
|
||||
host = req.Host // host does not contain a port
|
||||
}
|
||||
}
|
||||
|
||||
// check for an ip address
|
||||
if net.ParseIP(host) != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user