diff options
author | Andrew Morgan <andrew@amorgan.xyz> | 2019-05-02 16:53:51 -0700 |
---|---|---|
committer | Andrew Morgan <andrew@amorgan.xyz> | 2019-05-02 16:53:51 -0700 |
commit | 152d7a8eaf403716cb4dbf51b05795fe59e33b64 (patch) | |
tree | f3e13cf9d9719efe39b5abdfcfc8859747cbdc1a | |
parent | We can't throw exceptions in an IResolutionReceiver (diff) | |
download | synapse-152d7a8eaf403716cb4dbf51b05795fe59e33b64.tar.xz |
Remove different behaviour for fed vs. nonfed
-rw-r--r-- | synapse/http/client.py | 3 | ||||
-rw-r--r-- | synapse/http/matrixfederationclient.py | 1 | ||||
-rw-r--r-- | tests/http/test_fedclient.py | 4 |
3 files changed, 3 insertions, 5 deletions
diff --git a/synapse/http/client.py b/synapse/http/client.py index 6bd47cbfab..3af5de52d7 100644 --- a/synapse/http/client.py +++ b/synapse/http/client.py @@ -76,7 +76,7 @@ class IPBlacklistingResolver(object): addresses, preventing DNS rebinding attacks on URL preview. """ - def __init__(self, reactor, ip_whitelist, ip_blacklist, federation=False): + def __init__(self, reactor, ip_whitelist, ip_blacklist): """ Args: reactor (twisted.internet.reactor) @@ -87,7 +87,6 @@ class IPBlacklistingResolver(object): self._reactor = reactor self._ip_whitelist = ip_whitelist self._ip_blacklist = ip_blacklist - self._from_federation = federation def resolveHostName(self, recv, hostname, portNumber=0): diff --git a/synapse/http/matrixfederationclient.py b/synapse/http/matrixfederationclient.py index 71685f4352..6fe337e4bb 100644 --- a/synapse/http/matrixfederationclient.py +++ b/synapse/http/matrixfederationclient.py @@ -182,7 +182,6 @@ class MatrixFederationHttpClient(object): # addresses, to prevent DNS rebinding. nameResolver = IPBlacklistingResolver( real_reactor, None, hs.config.federation_ip_range_blacklist, - federation=True, ) @implementer(IReactorPluggableNameResolver) diff --git a/tests/http/test_fedclient.py b/tests/http/test_fedclient.py index e5de0f5c2a..81aa74920c 100644 --- a/tests/http/test_fedclient.py +++ b/tests/http/test_fedclient.py @@ -233,7 +233,7 @@ class FederationClientTests(HomeserverTestCase): fetch_d = cl.get_json("internal:8008", "foo/bar") # Nothing happened yet - #self.assertNoResult(fetch_d) + self.assertNoResult(fetch_d) # should have reset logcontext to the sentinel check_logcontext(LoggingContext.sentinel) @@ -249,7 +249,7 @@ class FederationClientTests(HomeserverTestCase): self.pump() # Nothing has happened yet - self.failureResultOf(d, SynapseError) + self.assertNoResult(d) # Check that it was unable to resolve the address clients = self.reactor.tcpClients |