forked from zaclys/searxng
[enh] allow default empty values for normal and result proxies
This commit is contained in:
parent
1794f6a4d3
commit
f2b13a7de0
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue