Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d3060f2

Browse files
committed
Minor improvement
1 parent aa95a05 commit d3060f2

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

lib/core/common.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2833,7 +2833,7 @@ def showHttpErrorCodes():
28332833
for code, count in kb.httpErrorCodes.items())
28342834
logger.warn(warnMsg)
28352835
if not kb.injections:
2836-
if any(str(_).startswith('4') or str(_).startswith('5') for _ in kb.httpErrorCodes.keys()):
2836+
if any((str(_).startswith('4') or str(_).startswith('5')) and _ != httplib.INTERNAL_SERVER_ERROR and _ != kb.originalCode for _ in kb.httpErrorCodes.keys()):
28372837
msg = "too many 4xx and/or 5xx HTTP error codes "
28382838
msg += "could mean that some kind of protection is involved (e.g. WAF)"
28392839
logger.warn(msg)

lib/request/connect.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -476,8 +476,9 @@ def getPage(**kwargs):
476476
page = page if isinstance(page, unicode) else getUnicode(page)
477477

478478
code = e.code
479-
threadData.lastHTTPError = (threadData.lastRequestUID, code)
480479

480+
kb.originalCode = kb.originalCode or code
481+
threadData.lastHTTPError = (threadData.lastRequestUID, code)
481482
kb.httpErrorCodes[code] = kb.httpErrorCodes.get(code, 0) + 1
482483

483484
status = getUnicode(e.msg)

0 commit comments

Comments
 (0)