mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-07-02 02:43:35 +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,6 +118,7 @@ class ProxyHTTPHandler(urllib2.HTTPHandler):
|
||||||
|
|
||||||
return urllib2.HTTPHandler.do_open(self, ProxyHTTPConnection, req)
|
return urllib2.HTTPHandler.do_open(self, ProxyHTTPConnection, req)
|
||||||
|
|
||||||
|
if PYVERSION >= "2.6":
|
||||||
class ProxyHTTPSHandler(urllib2.HTTPSHandler):
|
class ProxyHTTPSHandler(urllib2.HTTPSHandler):
|
||||||
def __init__(self, proxy=None, debuglevel=0):
|
def __init__(self, proxy=None, debuglevel=0):
|
||||||
self.proxy = proxy
|
self.proxy = proxy
|
||||||
|
@ -128,3 +130,8 @@ class ProxyHTTPSHandler(urllib2.HTTPSHandler):
|
||||||
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