fix for redirect/HOST header bug

This commit is contained in:
Miroslav Stampar
2011-11-11 11:28:27 +00:00
parent 1061c06617
commit ccbd93cc2e
4 changed files with 32 additions and 8 deletions

View File

@@ -3127,4 +3127,12 @@ def findPageForms(content, url, raise_=False, addToTargets=False):
for target in retVal:
kb.targetUrls.add(target)
return retVal
def getHostHeader(url):
retVal = urlparse.urlparse(url).netloc
if any(map(lambda x: retVal.endswith(':%d' % x), [80, 443])):
retVal = retVal.split(':')[0]
return retVal