mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-07-27 08:30:10 +03:00
Fix python3 binary - character mismatch in api.py
Convert between text and binary data in api.py call to urllib.request and response from it. In python3 sqlmapapi -c it fixes, at least - not nice output from log/list commands - any command that POSTs data (including new) crashing sqlmapapi
This commit is contained in:
parent
c082067902
commit
0b715f7b0e
|
@ -713,7 +713,7 @@ def _client(url, options=None):
|
|||
try:
|
||||
data = None
|
||||
if options is not None:
|
||||
data = jsonize(options)
|
||||
data = jsonize(options).encode("utf-8")
|
||||
headers = {"Content-Type": "application/json"}
|
||||
|
||||
if DataStore.username or DataStore.password:
|
||||
|
@ -721,7 +721,7 @@ def _client(url, options=None):
|
|||
|
||||
req = _urllib.request.Request(url, data, headers)
|
||||
response = _urllib.request.urlopen(req)
|
||||
text = response.read()
|
||||
text = response.read().decode("utf-8")
|
||||
except:
|
||||
if options:
|
||||
logger.error("Failed to load and parse %s" % url)
|
||||
|
|
Loading…
Reference in New Issue
Block a user