mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-12-09 14:11:29 +00:00
Fix for an Issue #101
This commit is contained in:
@@ -3050,12 +3050,15 @@ def getHostHeader(url):
|
||||
Returns proper Host header value for a given target URL
|
||||
"""
|
||||
|
||||
retVal = urlparse.urlparse(url).netloc
|
||||
retVal = url
|
||||
|
||||
if re.search("http(s)?://\[.+\]", url, re.I):
|
||||
retVal = extractRegexResult("http(s)?://\[(?P<result>.+)\]", url)
|
||||
elif any(retVal.endswith(':%d' % _) for _ in (80, 443)):
|
||||
retVal = retVal.split(':')[0]
|
||||
if url:
|
||||
retVal = urlparse.urlparse(url).netloc
|
||||
|
||||
if re.search("http(s)?://\[.+\]", url, re.I):
|
||||
retVal = extractRegexResult("http(s)?://\[(?P<result>.+)\]", url)
|
||||
elif any(retVal.endswith(':%d' % _) for _ in (80, 443)):
|
||||
retVal = retVal.split(':')[0]
|
||||
|
||||
return retVal
|
||||
|
||||
|
||||
Reference in New Issue
Block a user