diff --git a/lib/core/common.py b/lib/core/common.py index f9ce59aa6..233de59d7 100644 --- a/lib/core/common.py +++ b/lib/core/common.py @@ -3056,7 +3056,9 @@ def getHostHeader(url): retVal = urlparse.urlparse(url).netloc - if any(retVal.endswith(':%d' % _) for _ in [80, 443]): + if re.search("http(s)?://\[.+\]", url, re.I): + retVal = extractRegexResult("http(s)?://\[(?P.+)\]", url) + elif any(retVal.endswith(':%d' % _) for _ in [80, 443]): retVal = retVal.split(':')[0] return retVal