Skip to content

Commit a7d1a0c

Browse files
committed
Implementation for an Issue sqlmapproject#117
1 parent 3279ce5 commit a7d1a0c

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

lib/core/settings.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,12 @@
7070
# length of queue for candidates for time delay adjustment
7171
TIME_DELAY_CANDIDATES = 3
7272

73-
# standard value for HTTP Accept header
73+
# default value for HTTP Accept header
7474
HTTP_ACCEPT_HEADER_VALUE = "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"
7575

76+
# default value for HTTP Accept-Encoding header
77+
HTTP_ACCEPT_ENCODING_HEADER_VALUE = "gzip,deflate"
78+
7679
# HTTP timeout in silent mode
7780
HTTP_SILENT_TIMEOUT = 3
7881

lib/request/connect.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
from lib.core.exception import sqlmapSyntaxException
4949
from lib.core.settings import CUSTOM_INJECTION_MARK_CHAR
5050
from lib.core.settings import HTTP_ACCEPT_HEADER_VALUE
51+
from lib.core.settings import HTTP_ACCEPT_ENCODING_HEADER_VALUE
5152
from lib.core.settings import HTTP_SILENT_TIMEOUT
5253
from lib.core.settings import MAX_CONNECTION_CHUNK_SIZE
5354
from lib.core.settings import META_REFRESH_REGEX
@@ -267,6 +268,7 @@ def getPage(**kwargs):
267268
headers[HTTPHEADER.PROXY_AUTHORIZATION] = kb.proxyAuthHeader
268269

269270
headers[HTTPHEADER.ACCEPT] = HTTP_ACCEPT_HEADER_VALUE
271+
headers[HTTPHEADER.ACCEPT_ENCODING] = HTTP_ACCEPT_ENCODING_HEADER_VALUE
270272

271273
headers[HTTPHEADER.HOST] = host or getHostHeader(url)
272274

@@ -286,9 +288,6 @@ def getPage(**kwargs):
286288
else:
287289
req = urllib2.Request(url, post, headers)
288290

289-
if not req.has_header(HTTPHEADER.ACCEPT_ENCODING):
290-
requestHeaders += "%s: identity\n" % HTTPHEADER.ACCEPT_ENCODING
291-
292291
requestHeaders += "\n".join("%s: %s" % (key.capitalize() if isinstance(key, basestring) else key, getUnicode(value)) for (key, value) in req.header_items())
293292

294293
if not req.has_header(HTTPHEADER.COOKIE) and conf.cj:

0 commit comments

Comments
 (0)