File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 77See the file 'doc/COPYING' for copying permission
88"""
99
10+ import httplib
1011import logging
1112import re
1213import socket
@@ -972,7 +973,7 @@ def checkConnection(suppressOutput=False):
972973 errMsg = getUnicode (errMsg )
973974 logger .critical (errMsg )
974975
975- if any (code in kb .httpErrorCodes for code in (404 , )):
976+ if any (code in kb .httpErrorCodes for code in (httplib . NOT_FOUND , )):
976977 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] "
977978 if readInput (msg , default = "Y" ) not in ("n" , "N" ):
978979 raise sqlmapSilentQuitException
Original file line number Diff line number Diff line change @@ -425,19 +425,19 @@ def getPage(**kwargs):
425425
426426 logger .log (7 , responseMsg )
427427
428- if e .code == 401 :
428+ if e .code == httplib . UNAUTHORIZED :
429429 errMsg = "not authorized, try to provide right HTTP "
430430 errMsg += "authentication type and valid credentials (%d)" % code
431431 raise sqlmapConnectionException , errMsg
432- elif e .code == 404 :
432+ elif e .code == httplib . NOT_FOUND :
433433 if raise404 :
434434 errMsg = "page not found (%d)" % code
435435 raise sqlmapConnectionException , errMsg
436436 else :
437437 debugMsg = "page not found (%d)" % code
438438 logger .debug (debugMsg )
439439 processResponse (page , responseHeaders )
440- elif e .code == 504 :
440+ elif e .code == httplib . GATEWAY_TIMEOUT :
441441 if ignoreTimeout :
442442 return None , None , None
443443 else :
You can’t perform that action at this time.
0 commit comments