summary refs log tree commit diff
path: root/synapse/http
diff options
context:
space:
mode:
authorMatthew Hodgson <matthew@matrix.org>2016-03-29 03:32:52 +0100
committerMatthew Hodgson <matthew@matrix.org>2016-03-29 03:32:52 +0100
commit721b2bfa851bcf91948e166587dce4da666739b1 (patch)
treee33afb28d241ef5fd0d88bca103e6f31842e4845 /synapse/http
parentdebug (diff)
downloadsynapse-721b2bfa851bcf91948e166587dce4da666739b1.tar.xz
implement redirects
Diffstat (limited to 'synapse/http')
-rw-r--r--synapse/http/client.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/synapse/http/client.py b/synapse/http/client.py
index cfdea91b57..71b2e3375e 100644
--- a/synapse/http/client.py
+++ b/synapse/http/client.py
@@ -23,7 +23,7 @@ from canonicaljson import encode_canonical_json
 
 from twisted.internet import defer, reactor, ssl, protocol
 from twisted.web.client import (
-    Agent, readBody, FileBodyProducer, PartialDownloadError,
+    RedirectAgent, Agent, readBody, FileBodyProducer, PartialDownloadError,
 )
 from twisted.web.http_headers import Headers
 from twisted.web._newclient import ResponseDone
@@ -59,11 +59,11 @@ class SimpleHttpClient(object):
         # The default context factory in Twisted 14.0.0 (which we require) is
         # BrowserLikePolicyForHTTPS which will do regular cert validation
         # 'like a browser'
-        self.agent = Agent(
+        self.agent = RedirectAgent(Agent(
             reactor,
             connectTimeout=15,
             contextFactory=hs.get_http_client_context_factory()
-        )
+        ))
         self.user_agent = hs.version_string
         if hs.config.user_agent_suffix:
             self.user_agent = "%s %s" % (self.user_agent, hs.config.user_agent_suffix,)