[enh] basic support for http proxy (see #236)

This commit is contained in:
Alexandre Flament 2015-04-25 11:44:53 +02:00
parent 33516256fd
commit cde37be4f5
3 changed files with 13 additions and 2 deletions

View file

@ -110,6 +110,7 @@ _category_names = (gettext('files'),
gettext('news'),
gettext('map'))
outgoing_proxies = settings.get('outgoing_proxies', None)
@babel.localeselector
def get_locale():
@ -638,7 +639,8 @@ def image_proxy():
resp = requests.get(url,
stream=True,
timeout=settings['server'].get('request_timeout', 2),
headers=headers)
headers=headers,
proxies=outgoing_proxies)
if resp.status_code == 304:
return '', resp.status_code