summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPablo Suárez Hernández <psuarezhernandez@suse.com>2022-06-03 16:45:32 +0100
committerNeal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>2022-09-02 10:11:29 -0400
commiteca360d187202cdf54b7c88fbe2203760d3110fb (patch)
tree37a57b92f2980176d9c4ac8b82baa1c275319194
parentef676f2767c37cf16046a008e820e96e8ff46d57 (diff)
downloadurlgrabber-eca360d187202cdf54b7c88fbe2203760d3110fb.tar.gz
Fix wrong logic for find_proxy method
-rw-r--r--urlgrabber/grabber.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/urlgrabber/grabber.py b/urlgrabber/grabber.py
index 8f464d0..d1c83b8 100644
--- a/urlgrabber/grabber.py
+++ b/urlgrabber/grabber.py
@@ -983,16 +983,18 @@ class URLGrabberOptions:
Use the proxies dictionary first, then libproxy.
"""
self.proxy = None
- if scheme not in ('ftp', 'http', 'https'):
+ if scheme not in (b'ftp', b'http', b'https'):
return
if self.proxies:
proxy = self.proxies.get(scheme)
if proxy is None:
- if scheme == 'http':
- proxy = self.proxies.get('https')
- elif scheme == 'https':
+ if scheme == b'http':
proxy = self.proxies.get('http')
+ elif scheme == b'https':
+ proxy = self.proxies.get('https')
+ elif scheme == b'ftp':
+ proxy = self.proxies.get('ftp')
if proxy == '_none_':
proxy = ''
self.proxy = proxy