mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2026-08-28 04:33:16 +00:00
Fix for an Issue #101
This commit is contained in:
parent
c96e44b30c
commit
81d15e5051
2 changed files with 14 additions and 10 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue