mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2024-11-25 19:13:48 +03:00
minor code restyling
This commit is contained in:
parent
e33a48d40f
commit
6a8a5db9aa
|
@ -1054,18 +1054,18 @@ def __setHTTPUserAgent():
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
__count = len(kb.userAgents)
|
count = len(kb.userAgents)
|
||||||
|
|
||||||
if __count == 1:
|
if count == 1:
|
||||||
__userAgent = kb.userAgents[0]
|
userAgent = kb.userAgents[0]
|
||||||
else:
|
else:
|
||||||
__userAgent = kb.userAgents[randomRange(stop=__count-1)]
|
userAgent = kb.userAgents[randomRange(stop=count-1)]
|
||||||
|
|
||||||
__userAgent = sanitizeStr(__userAgent)
|
userAgent = sanitizeStr(userAgent)
|
||||||
conf.httpHeaders.append((HTTPHEADER.USER_AGENT, __userAgent))
|
conf.httpHeaders.append((HTTPHEADER.USER_AGENT, userAgent))
|
||||||
|
|
||||||
logMsg = "fetched random HTTP User-Agent header from "
|
logMsg = "fetched random HTTP User-Agent header from "
|
||||||
logMsg += "file '%s': %s" % (paths.USER_AGENTS, __userAgent)
|
logMsg += "file '%s': %s" % (paths.USER_AGENTS, userAgent)
|
||||||
logger.info(logMsg)
|
logger.info(logMsg)
|
||||||
|
|
||||||
def __setHTTPReferer():
|
def __setHTTPReferer():
|
||||||
|
|
Loading…
Reference in New Issue
Block a user