Minor update

This commit is contained in:
Miroslav Stampar 2012-10-07 20:28:24 +02:00
parent ff205f088b
commit 8e7449ccd5
2 changed files with 7 additions and 5 deletions

View File

@ -201,7 +201,7 @@ def __feedTargetsDict(reqFile, addedTargetUrls):
logger.debug("not a valid WebScarab log data")
continue
if method.upper() == "POST":
if method.upper() == HTTPMETHOD.POST:
warnMsg = "POST requests from WebScarab logs aren't supported "
warnMsg += "as their body content is stored in separate files. "
warnMsg += "Nevertheless you can use -r to load them individually."
@ -1170,24 +1170,24 @@ def __setHTTPUserAgent():
item = item[item.find(';') + 1:]
conf.httpHeaders.append(("User-Agent", item))
conf.httpHeaders.append((HTTPHEADER.USER_AGENT, item))
elif conf.agent:
debugMsg = "setting the HTTP User-Agent header"
logger.debug(debugMsg)
conf.httpHeaders.append(("User-Agent", conf.agent))
conf.httpHeaders.append((HTTPHEADER.USER_AGENT, conf.agent))
elif not conf.randomAgent:
_ = True
for header, _ in conf.httpHeaders:
if header == "User-Agent":
if header == HTTPHEADER.USER_AGENT:
_ = False
break
if _:
conf.httpHeaders.append(("User-Agent", __defaultHTTPUserAgent()))
conf.httpHeaders.append((HTTPHEADER.USER_AGENT, __defaultHTTPUserAgent()))
else:
if not kb.userAgents:

View File

@ -51,6 +51,8 @@ def forgeHeaders(items=None):
headers = dict(conf.httpHeaders)
headers.update(items or {})
headers = dict(("-".join(_.capitalize() for _ in key.split('-')), value) for (key, value) in headers.items())
if conf.cj:
if HTTPHEADER.COOKIE in headers:
for cookie in conf.cj: