mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2024-11-22 17:46:37 +03:00
minor beautification
This commit is contained in:
parent
27d244b326
commit
c57941c102
|
@ -7,6 +7,7 @@ Copyright (c) 2006-2011 sqlmap developers (http://www.sqlmap.org/)
|
|||
See the file 'doc/COPYING' for copying permission
|
||||
"""
|
||||
|
||||
import httplib
|
||||
import logging
|
||||
import re
|
||||
import socket
|
||||
|
@ -972,7 +973,7 @@ def checkConnection(suppressOutput=False):
|
|||
errMsg = getUnicode(errMsg)
|
||||
logger.critical(errMsg)
|
||||
|
||||
if any(code in kb.httpErrorCodes for code in (404, )):
|
||||
if any(code in kb.httpErrorCodes for code in (httplib.NOT_FOUND, )):
|
||||
msg = "it is not recommended to continue in this kind of cases. Do you want to quit and make sure that everything is set up properly? [Y/n] "
|
||||
if readInput(msg, default="Y") not in ("n", "N"):
|
||||
raise sqlmapSilentQuitException
|
||||
|
|
|
@ -425,11 +425,11 @@ class Connect:
|
|||
|
||||
logger.log(7, responseMsg)
|
||||
|
||||
if e.code == 401:
|
||||
if e.code == httplib.UNAUTHORIZED:
|
||||
errMsg = "not authorized, try to provide right HTTP "
|
||||
errMsg += "authentication type and valid credentials (%d)" % code
|
||||
raise sqlmapConnectionException, errMsg
|
||||
elif e.code == 404:
|
||||
elif e.code == httplib.NOT_FOUND:
|
||||
if raise404:
|
||||
errMsg = "page not found (%d)" % code
|
||||
raise sqlmapConnectionException, errMsg
|
||||
|
@ -437,7 +437,7 @@ class Connect:
|
|||
debugMsg = "page not found (%d)" % code
|
||||
logger.debug(debugMsg)
|
||||
processResponse(page, responseHeaders)
|
||||
elif e.code == 504:
|
||||
elif e.code == httplib.GATEWAY_TIMEOUT:
|
||||
if ignoreTimeout:
|
||||
return None, None, None
|
||||
else:
|
||||
|
|
Loading…
Reference in New Issue
Block a user