contains missing host port

This commit is contained in:
Asim Aslam 2020-04-07 00:54:27 +01:00
parent 5374896ed0
commit e8a86585da

View File

@ -148,7 +148,7 @@ func namespaceFromRequest(req *http.Request) (string, error) {
// fallback to req.Host
var err error
host, _, err = net.SplitHostPort(req.Host)
if err != nil && err.Error() == "missing port in address" {
if err != nil && strings.Contains(err.Error(), "missing port in address") {
host = req.Host
}
}