|
46 | 46 | from lib.core.enums import PAYLOAD |
47 | 47 | from lib.core.enums import PLACE |
48 | 48 | from lib.core.enums import REDIRECTION |
| 49 | +from lib.core.exception import sqlmapCompressionException |
49 | 50 | from lib.core.exception import sqlmapConnectionException |
50 | 51 | from lib.core.exception import sqlmapSyntaxException |
51 | 52 | from lib.core.settings import CUSTOM_INJECTION_MARK_CHAR |
@@ -108,7 +109,7 @@ def __retryProxy(**kwargs): |
108 | 109 | warnMsg += "(e.g. https://help.ubuntu.com/community/Tor)" |
109 | 110 | else: |
110 | 111 | warnMsg = "if the problem persists please check that the provided " |
111 | | - warnMsg += "target url is valid. If it is, you can try to rerun " |
| 112 | + warnMsg += "target url is valid. In case that it is, you can try to rerun " |
112 | 113 | warnMsg += "with the switch '--random-agent' turned on " |
113 | 114 | warnMsg += "and/or proxy switches (--ignore-proxy, --proxy,...)" |
114 | 115 | singleTimeWarnMessage(warnMsg) |
@@ -279,7 +280,7 @@ def getPage(**kwargs): |
279 | 280 | headers[HTTPHEADER.PROXY_AUTHORIZATION] = kb.proxyAuthHeader |
280 | 281 |
|
281 | 282 | headers[HTTPHEADER.ACCEPT] = HTTP_ACCEPT_HEADER_VALUE |
282 | | - headers[HTTPHEADER.ACCEPT_ENCODING] = HTTP_ACCEPT_ENCODING_HEADER_VALUE if method != HTTPMETHOD.HEAD else "identity" |
| 283 | + headers[HTTPHEADER.ACCEPT_ENCODING] = HTTP_ACCEPT_ENCODING_HEADER_VALUE if method != HTTPMETHOD.HEAD and kb.pageCompress else "identity" |
283 | 284 | headers[HTTPHEADER.HOST] = host or getHostHeader(url) |
284 | 285 |
|
285 | 286 | if auxHeaders: |
@@ -467,7 +468,7 @@ def getPage(**kwargs): |
467 | 468 | debugMsg = "got HTTP error code: %d (%s)" % (code, status) |
468 | 469 | logger.debug(debugMsg) |
469 | 470 |
|
470 | | - except (urllib2.URLError, socket.error, socket.timeout, httplib.BadStatusLine, httplib.IncompleteRead, ProxyError), e: |
| 471 | + except (urllib2.URLError, socket.error, socket.timeout, httplib.BadStatusLine, httplib.IncompleteRead, ProxyError, sqlmapCompressionException), e: |
471 | 472 | tbMsg = traceback.format_exc() |
472 | 473 |
|
473 | 474 | if "no host given" in tbMsg: |
|
0 commit comments