diff options
author | Richard van der Hoff <1389908+richvdh@users.noreply.github.com> | 2019-01-30 11:43:33 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-30 11:43:33 +0000 |
commit | c7b24ac3d0e202a406bc1f972b6c3da52c7e25c4 (patch) | |
tree | 25c3b5d90c1ac36765ba7d74c76df387ab87002a /synapse/http/federation | |
parent | SIGHUP for TLS cert reloading (#4495) (diff) | |
download | synapse-c7b24ac3d0e202a406bc1f972b6c3da52c7e25c4.tar.xz |
Follow redirects on .well-known (#4520)
Diffstat (limited to 'synapse/http/federation')
-rw-r--r-- | synapse/http/federation/matrix_federation_agent.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/synapse/http/federation/matrix_federation_agent.py b/synapse/http/federation/matrix_federation_agent.py index 29804efe10..eeb3665f7d 100644 --- a/synapse/http/federation/matrix_federation_agent.py +++ b/synapse/http/federation/matrix_federation_agent.py @@ -23,7 +23,7 @@ from zope.interface import implementer from twisted.internet import defer from twisted.internet.endpoints import HostnameEndpoint, wrapClientTLS -from twisted.web.client import URI, Agent, HTTPConnectionPool, readBody +from twisted.web.client import URI, Agent, HTTPConnectionPool, RedirectAgent, readBody from twisted.web.http import stringToDatetime from twisted.web.http_headers import Headers from twisted.web.iweb import IAgent @@ -93,7 +93,9 @@ class MatrixFederationAgent(object): # the param is called 'contextFactory', but actually passing a # contextfactory is deprecated, and it expects an IPolicyForHTTPS. agent_args['contextFactory'] = _well_known_tls_policy - _well_known_agent = Agent(self._reactor, pool=self._pool, **agent_args) + _well_known_agent = RedirectAgent( + Agent(self._reactor, pool=self._pool, **agent_args), + ) self._well_known_agent = _well_known_agent self._well_known_cache = _well_known_cache |