mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2026-10-12 11:31:05 +00:00
Fixes Python3 support for --chunked (drei)
This commit is contained in:
parent
4cf14c80eb
commit
8c57b9cd4c
4 changed files with 34 additions and 1 deletions
|
|
@ -193,6 +193,25 @@ class ReqHandler(BaseHTTPRequestHandler):
|
|||
data = self.rfile.read(length)
|
||||
data = unquote_plus(data.decode(UNICODE_ENCODING, "ignore"))
|
||||
self.data = data
|
||||
elif self.headers.get("Transfer-encoding") == "chunked":
|
||||
data, line = b"", b""
|
||||
count = 0
|
||||
|
||||
while True:
|
||||
line += self.rfile.read(1)
|
||||
if line.endswith(b'\n'):
|
||||
if count % 2 == 1:
|
||||
current = line.rstrip(b"\r\n")
|
||||
if not current:
|
||||
break
|
||||
else:
|
||||
data += current
|
||||
|
||||
count += 1
|
||||
line = b""
|
||||
|
||||
self.data = data.decode(UNICODE_ENCODING, "ignore")
|
||||
|
||||
self.do_REQUEST()
|
||||
|
||||
def log_message(self, format, *args):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue