Support IPv6 literals ("[::1]:8080") in the proxy switch.

This commit is contained in:
Ryan Young 2019-12-14 22:17:28 -08:00
parent 3145de15d8
commit 55206b9eaa

View File

@ -995,7 +995,7 @@ def _setHTTPHandlers():
errMsg = "invalid proxy address '%s' ('%s')" % (conf.proxy, getSafeExString(ex))
raise SqlmapSyntaxException(errMsg)
hostnamePort = _.netloc.split(":")
hostnamePort = _.netloc.rsplit(":", 1)
scheme = _.scheme.upper()
hostname = hostnamePort[0]