Skip to content

Commit bb725d2

Browse files
committed
Fixes #5885
1 parent 04b293d commit bb725d2

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

data/txt/sha256sums.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ c6a182f6b7d3b0ad6f0888ea2a4de4148f0770549038d7de8bc3267b4c6635f7 lib/core/readl
188188
63ae69713c6ea9abfa10e71dfab8f2dcf42432177a38d2c1e98785bf1468674c lib/core/replication.py
189189
5bad5bc7115051cef7b84efa73fbafbf5e1db46eef32a445056b56cda750b66f lib/core/revision.py
190190
0dcb52c9c76a4b0acf2e9038f7d8f08c14543cef3cf7032831c6c0a99376ad24 lib/core/session.py
191-
f04c8a49a6c7205949d54bed4226abf8ab97361ceb4e0325fc260456a0ad412f lib/core/settings.py
191+
75d5ce99d50b42999fcbcd05edade1e9774c383bbdeddafd2a4c91d287f610e1 lib/core/settings.py
192192
a1e4f2860bffc73bbf2e5db293fa49dcb600ea35f950cda43dc953b3160ab3db lib/core/shell.py
193193
841716e87b90a3b598515910841f7cf8d33bb87c24a27fba1a80e36a831cbcd7 lib/core/subprocessng.py
194194
9731092f195e346716929323ea3c93247b23b9b92b0f32d3fd0acc3adf9876cc lib/core/target.py
@@ -211,7 +211,7 @@ cbabdde72df4bd8d6961d589f1721dd938d8f653aa6af8900a31af6e2586405d lib/parse/site
211211
89417568d7f19e48d39a8a9a4227d3d2b71d1c9f61139a41b1835fb5266fcab8 lib/request/basic.py
212212
6139b926a3462d14ddd50acdb8575ae442b8fab089db222721535092b9af3ea1 lib/request/chunkedhandler.py
213213
6be5719f3c922682931779830a4571a13d5612a69e2423fd60a254e8dbceaf5c lib/request/comparison.py
214-
7345c12a0a1d4c583766b46ba38263cbc4603a85aa4216deddd62958d4e5d596 lib/request/connect.py
214+
b27dd003eba5ac4697b6a1d5a6712e6aca380436a5a379bd5f2e831d6dca19bd lib/request/connect.py
215215
0649a39c5cc2fc0f4c062b100ced17e3e6934a7e578247dfc65b650edc29825e lib/request/direct.py
216216
5283754cf387ce4e645ee50834ee387cde29a768aaada1a6a07c338da216c94d lib/request/dns.py
217217
844fae318d6b3141bfc817aac7a29868497b5e7b4b3fdd7c751ad1d4a485324f lib/request/httpshandler.py

lib/core/settings.py

+3
Original file line numberDiff line numberDiff line change
@@ -835,6 +835,9 @@
835835
# Format used for representing invalid unicode characters
836836
INVALID_UNICODE_CHAR_FORMAT = r"\x%02x"
837837

838+
# Minimum supported version of httpx library (for --http2)
839+
MIN_HTTPX_VERSION = "0.28"
840+
838841
# Regular expression for XML POST data
839842
XML_RECOGNITION_REGEX = r"(?s)\A\s*<[^>]+>(.+>)?\s*\Z"
840843

lib/request/connect.py

+5
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ class WebSocketException(Exception):
6262
from lib.core.common import urldecode
6363
from lib.core.common import urlencode
6464
from lib.core.common import wasLastResponseDelayed
65+
from lib.core.compat import LooseVersion
6566
from lib.core.compat import patchHeaders
6667
from lib.core.compat import xrange
6768
from lib.core.convert import encodeBase64
@@ -109,6 +110,7 @@ class WebSocketException(Exception):
109110
from lib.core.settings import JAVASCRIPT_HREF_REGEX
110111
from lib.core.settings import LARGE_READ_TRIM_MARKER
111112
from lib.core.settings import LIVE_COOKIES_TIMEOUT
113+
from lib.core.settings import MIN_HTTPX_VERSION
112114
from lib.core.settings import MAX_CONNECTION_READ_SIZE
113115
from lib.core.settings import MAX_CONNECTIONS_REGEX
114116
from lib.core.settings import MAX_CONNECTION_TOTAL_SIZE
@@ -618,6 +620,9 @@ class _(dict):
618620
except ImportError:
619621
raise SqlmapMissingDependence("httpx[http2] not available (e.g. 'pip%s install httpx[http2]')" % ('3' if six.PY3 else ""))
620622

623+
if LooseVersion(httpx.__version__) < LooseVersion(MIN_HTTPX_VERSION):
624+
raise SqlmapMissingDependence("outdated version of httpx detected (%s<%s)" % (httpx.__version__, MIN_HTTPX_VERSION))
625+
621626
try:
622627
proxy_mounts = dict(("%s://" % key, httpx.HTTPTransport(proxy="%s%s" % ("http://" if not "://" in kb.proxies[key] else "", kb.proxies[key]))) for key in kb.proxies) if kb.proxies else None
623628
with httpx.Client(verify=False, http2=True, timeout=timeout, follow_redirects=True, cookies=conf.cj, mounts=proxy_mounts) as client:

0 commit comments

Comments
 (0)