Skip to content

Commit d247fda

Browse files
committed
Fixing HTTP chunking for Python2.6
1 parent 78b1c4f commit d247fda

File tree

4 files changed

+12
-4
lines changed

4 files changed

+12
-4
lines changed

lib/core/option.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2477,7 +2477,15 @@ def _setTorSocksProxySettings():
24772477

24782478
def _setHttpChunked():
24792479
if conf.chunked and conf.data:
2480-
_http_client.HTTPConnection._set_content_length = lambda self, *args, **kwargs: None
2480+
if hasattr(_http_client.HTTPConnection, "_set_content_length"):
2481+
_http_client.HTTPConnection._set_content_length = lambda self, *args, **kwargs: None
2482+
else:
2483+
def putheader(self, header, *values):
2484+
if header != HTTP_HEADER.CONTENT_LENGTH:
2485+
self._putheader(header, *values)
2486+
2487+
_http_client.HTTPConnection._putheader = _http_client.HTTPConnection.putheader
2488+
_http_client.HTTPConnection.putheader = putheader
24812489

24822490
def _checkWebSocket():
24832491
if conf.url and (conf.url.startswith("ws:/") or conf.url.startswith("wss:/")):

lib/core/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
from thirdparty.six import unichr as _unichr
1919

2020
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
21-
VERSION = "1.5.1.47"
21+
VERSION = "1.5.2.0"
2222
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
2323
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
2424
VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)

lib/core/testing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ def _thread():
134134
for tag, value in (("<url>", url), ("<direct>", direct), ("<request>", request), ("<log>", log), ("<config>", config), ("<base64>", url.replace("id=1", "id=MZ=%3d"))):
135135
options = options.replace(tag, value)
136136

137-
cmd = "%s %s %s --batch --non-interactive --debug" % (sys.executable, os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..", "sqlmap.py")), options)
137+
cmd = "%s \"%s\" %s --batch --non-interactive --debug" % (sys.executable, os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..", "sqlmap.py")), options)
138138

139139
if "<tmp>" in cmd:
140140
handle, tmp = tempfile.mkstemp()

lib/parse/cmdline.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1068,7 +1068,7 @@ def _format_action_invocation(self, action):
10681068

10691069
except SystemExit:
10701070
# Protection against Windows dummy double clicking
1071-
if IS_WIN:
1071+
if IS_WIN and "--non-interactive" not in sys.argv:
10721072
dataToStdout("\nPress Enter to continue...")
10731073
_input()
10741074
raise

0 commit comments

Comments
 (0)