Don't trust env while accessing Tornado.

This fixes a problem where the requests to Tornado would attempt to
use a configured outgoing HTTP proxy, when really we want to connect
directly to localhost.

Fixes: #468.
This commit is contained in:
Umair Khan
2016-08-31 13:00:32 +05:00
committed by Tim Abbott
parent a4466c93a3
commit 6a12ad7c33

View File

@@ -36,6 +36,11 @@ import six
from six import text_type
requests_client = requests.Session()
for host in ['127.0.0.1', 'localhost']:
if settings.TORNADO_SERVER and host in settings.TORNADO_SERVER:
# This seems like the only working solution to ignore proxy in
# requests library.
requests_client.trust_env = False
# The idle timeout used to be a week, but we found that in that
# situation, queues from dead browser sessions would grow quite large