mirror of https://github.com/scrapy/scrapy.git
Do not set _scheme_proxy unless necessary
This commit is contained in:
parent
c5446c0b85
commit
247e24e5f4
|
|
@ -50,13 +50,14 @@ class HttpProxyMiddleware:
|
|||
creds, proxy_url = self._get_proxy(request.meta["proxy"], "")
|
||||
elif self.proxies:
|
||||
parsed = urlparse_cached(request)
|
||||
scheme = parsed.scheme
|
||||
_scheme = parsed.scheme
|
||||
if (
|
||||
# 'no_proxy' is only supported by http schemes
|
||||
scheme not in ("http", "https")
|
||||
_scheme not in ("http", "https")
|
||||
or not proxy_bypass(parsed.hostname)
|
||||
) and scheme in self.proxies:
|
||||
) and _scheme in self.proxies:
|
||||
creds, proxy_url = self.proxies[scheme]
|
||||
scheme = _scheme
|
||||
|
||||
self._set_proxy_and_creds(request, proxy_url, creds, scheme)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue