diff options
author | Adam Tauber <asciimoo@gmail.com> | 2017-07-19 21:33:44 +0200 |
---|---|---|
committer | Adam Tauber <asciimoo@gmail.com> | 2017-07-20 13:32:20 +0200 |
commit | f2b13a7de071cd68c9aeef7ff3e87ede88e677e8 (patch) | |
tree | 5b34d38b74c09ba53d70641b522296253bf42b39 /searx | |
parent | 1794f6a4d36cafcc4eb2a64e0145d937bc81bc34 (diff) | |
download | searxng-f2b13a7de071cd68c9aeef7ff3e87ede88e677e8.tar.gz searxng-f2b13a7de071cd68c9aeef7ff3e87ede88e677e8.zip |
[enh] allow default empty values for normal and result proxies
Diffstat (limited to 'searx')
-rw-r--r-- | searx/poolrequests.py | 2 | ||||
-rw-r--r-- | searx/webapp.py | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/searx/poolrequests.py b/searx/poolrequests.py index f268df207..628fd5dff 100644 --- a/searx/poolrequests.py +++ b/searx/poolrequests.py @@ -75,7 +75,7 @@ class SessionSinglePool(requests.Session): def request(method, url, **kwargs): """same as requests/requests/api.py request(...) except it use SessionSinglePool and force proxies""" session = SessionSinglePool() - kwargs['proxies'] = settings['outgoing'].get('proxies', None) + kwargs['proxies'] = settings['outgoing'].get('proxies') or None response = session.request(method=method, url=url, **kwargs) session.close() return response diff --git a/searx/webapp.py b/searx/webapp.py index 1e66590c1..3afdbefd8 100644 --- a/searx/webapp.py +++ b/searx/webapp.py @@ -142,7 +142,7 @@ _category_names = (gettext('files'), gettext('map'), gettext('science')) -outgoing_proxies = settings['outgoing'].get('proxies', None) +outgoing_proxies = settings['outgoing'].get('proxies') or None @babel.localeselector @@ -353,7 +353,7 @@ def render(template_name, override_theme=None, **kwargs): kwargs['image_proxify'] = image_proxify - kwargs['proxify'] = proxify if settings.get('result_proxy') else None + kwargs['proxify'] = proxify if settings.get('result_proxy', {}).get('url') else None kwargs['get_result_template'] = get_result_template |