mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-02-17 03:50:42 +03:00
fix for bug reported by Truong Duc Luong
This commit is contained in:
parent
b0ba559af5
commit
27d76847fe
|
@ -27,6 +27,7 @@ import socket
|
||||||
import urllib
|
import urllib
|
||||||
import urllib2
|
import urllib2
|
||||||
|
|
||||||
|
from lib.core.exception import sqlmapUnsupportedFeatureException
|
||||||
from lib.core.settings import PYVERSION
|
from lib.core.settings import PYVERSION
|
||||||
|
|
||||||
if PYVERSION >= "2.6":
|
if PYVERSION >= "2.6":
|
||||||
|
@ -117,14 +118,20 @@ class ProxyHTTPHandler(urllib2.HTTPHandler):
|
||||||
|
|
||||||
return urllib2.HTTPHandler.do_open(self, ProxyHTTPConnection, req)
|
return urllib2.HTTPHandler.do_open(self, ProxyHTTPConnection, req)
|
||||||
|
|
||||||
class ProxyHTTPSHandler(urllib2.HTTPSHandler):
|
if PYVERSION >= "2.6":
|
||||||
def __init__(self, proxy=None, debuglevel=0):
|
class ProxyHTTPSHandler(urllib2.HTTPSHandler):
|
||||||
self.proxy = proxy
|
def __init__(self, proxy=None, debuglevel=0):
|
||||||
|
self.proxy = proxy
|
||||||
|
|
||||||
urllib2.HTTPSHandler.__init__(self, debuglevel)
|
urllib2.HTTPSHandler.__init__(self, debuglevel)
|
||||||
|
|
||||||
def do_open(self, http_class, req):
|
def do_open(self, http_class, req):
|
||||||
if self.proxy is not None:
|
if self.proxy is not None:
|
||||||
req.set_proxy(self.proxy, "https")
|
req.set_proxy(self.proxy, "https")
|
||||||
|
|
||||||
return urllib2.HTTPSHandler.do_open(self, ProxyHTTPSConnection, req)
|
return urllib2.HTTPSHandler.do_open(self, ProxyHTTPSConnection, req)
|
||||||
|
else:
|
||||||
|
class ProxyHTTPSHandler:
|
||||||
|
def __init__(self, *args, **kwargs):
|
||||||
|
errMsg = "unsupported feature on versions of Python before 2.6"
|
||||||
|
raise sqlmapUnsupportedFeatureException, errMsg
|
||||||
|
|
Loading…
Reference in New Issue
Block a user