more pythonic check of noconnect in proxy params

This commit is contained in:
Konstantin Lopuhin 2016-01-19 17:32:53 +03:00
parent bb50c0be2f
commit 9c3117a914
1 changed files with 1 additions and 1 deletions

View File

@ -186,7 +186,7 @@ class ScrapyAgent(object):
_, _, proxyHost, proxyPort, proxyParams = _parse(proxy)
scheme = _parse(request.url)[0]
proxyHost = to_unicode(proxyHost)
omitConnectTunnel = proxyParams.find(b'noconnect') >= 0
omitConnectTunnel = b'noconnect' in proxyParams
if scheme == b'https' and not omitConnectTunnel:
proxyConf = (proxyHost, proxyPort,
request.headers.get(b'Proxy-Authorization', None))