Fix auth hosts bug
This commit is contained in:
parent
41b746e435
commit
b864b3e350
@ -101,8 +101,14 @@ func (h authHandler) ServeHTTP(w http.ResponseWriter, req *http.Request) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func namespaceFromRequest(req *http.Request) (string, error) {
|
func namespaceFromRequest(req *http.Request) (string, error) {
|
||||||
|
// determine the host, e.g. dev.micro.mu:8080
|
||||||
|
host := req.URL.Host
|
||||||
|
if len(host) == 0 {
|
||||||
|
host = req.Host
|
||||||
|
}
|
||||||
|
|
||||||
// check for an ip address
|
// check for an ip address
|
||||||
if net.ParseIP(req.Host) != nil {
|
if net.ParseIP(host) != nil {
|
||||||
return auth.DefaultNamespace, nil
|
return auth.DefaultNamespace, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user