mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2026-07-10 18:43:07 +00:00
Fixes #6080
This commit is contained in:
parent
5893f069ae
commit
c1516f1750
2 changed files with 10 additions and 4 deletions
|
|
@ -20,7 +20,7 @@ from lib.core.enums import OS
|
|||
from thirdparty import six
|
||||
|
||||
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
|
||||
VERSION = "1.10.7.50"
|
||||
VERSION = "1.10.7.51"
|
||||
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
|
||||
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
|
||||
VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)
|
||||
|
|
|
|||
|
|
@ -82,14 +82,20 @@ class SmartRedirectHandler(_urllib.request.HTTPRedirectHandler):
|
|||
redurl = self._get_header_redirect(headers) if not conf.ignoreRedirects else None
|
||||
|
||||
try:
|
||||
content = fp.fp.read(MAX_CONNECTION_TOTAL_SIZE)
|
||||
fp.fp = io.BytesIO(content)
|
||||
# Note: drain via the length-aware response (honors Content-Length/chunked), NOT the raw
|
||||
# socket 'fp.fp' - the latter has no HTTP framing, so on a Keep-Alive connection (no EOF)
|
||||
# it blocks for the whole '--timeout' on every redirect (Issue #6080)
|
||||
content = fp.read(MAX_CONNECTION_TOTAL_SIZE)
|
||||
except _http_client.IncompleteRead as ex:
|
||||
content = ex.partial
|
||||
fp.fp = io.BytesIO(content)
|
||||
except:
|
||||
content = b""
|
||||
|
||||
# back 'fp' with the captured body so it stays re-readable downstream (Issue #5985); the
|
||||
# length-aware read above has consumed the response, so restore both the buffer and read()
|
||||
fp.fp = io.BytesIO(content)
|
||||
fp.read = fp.fp.read
|
||||
|
||||
content = decodePage(content, headers.get(HTTP_HEADER.CONTENT_ENCODING), headers.get(HTTP_HEADER.CONTENT_TYPE))
|
||||
|
||||
threadData = getCurrentThreadData()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue