@@ -40,19 +40,6 @@ def getheader(self, name, default=None):
4040 """Returns a given response header."""
4141 return self .urllib3_response .getheader (name , default )
4242
43-
44- def _get_no_proxy (configuration ):
45- n1 = os .environ .get ('NO_PROXY' )
46- n2 = os .environ .get ('no_proxy' )
47- if configuration .no_proxy :
48- return configuration .no_proxy .split (',' )
49- elif n1 :
50- return n1 .split (',' )
51- elif n2 :
52- return n2 .split (',' )
53- return []
54-
55-
5643class RESTClientObject (object ):
5744
5845 def __init__ (self , configuration , pools_size = 4 , maxsize = None ):
@@ -62,18 +49,7 @@ def __init__(self, configuration, pools_size=4, maxsize=None):
6249 # maxsize is the number of requests to host that are allowed in parallel # noqa: E501
6350 # Custom SSL certificates and client certificates: http://urllib3.readthedocs.io/en/latest/advanced-usage.html # noqa: E501
6451
65- self ._configuration = configuration
66- self ._last_pm_proxy_url = None
67- self ._pools_size = pools_size
68- self ._maxsize = maxsize
69- self ._lock = threading .Lock ()
70- self .pool_manager = None
71-
72- def __init_pool_manager (self , configuration , host , pools_size , maxsize ):
73-
74- proxy_url = self .__get_proxy (host )
75- if proxy_url == self ._last_pm_proxy_url and self .pool_manager :
76- return
52+ proxy_url = self .__get_proxy (configuration )
7753
7854 # cert_reqs
7955 if configuration .verify_ssl :
@@ -134,12 +110,9 @@ def __init_pool_manager(self, configuration, host, pools_size, maxsize):
134110
135111 self ._last_pm_proxy_url = proxy_url
136112
137- def __get_proxy (self , host ):
138- configuration = self ._configuration
113+ def __get_proxy (self , configuration ):
139114 proxy_url = configuration .proxy
140- if host in _get_no_proxy (configuration ):
141- proxy_url = None
142- elif not configuration .proxy :
115+ if not proxy_url :
143116 if configuration .scheme == 'http' :
144117 if configuration .http_proxy :
145118 proxy_url = configuration .http_proxy
@@ -205,10 +178,6 @@ def request(self, method, url, query_params=None, headers=None,
205178 if 'Content-Type' not in headers :
206179 headers ['Content-Type' ] = 'application/json'
207180
208- host = headers .get ('Host' )
209- with self ._lock :
210- self .__init_pool_manager (self ._configuration , host , self ._pools_size , self ._maxsize )
211-
212181 try :
213182 # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE`
214183 if method in ['POST' , 'PUT' , 'PATCH' , 'OPTIONS' , 'DELETE' ]:
0 commit comments