From 999f7db6b0ad735ee7c952858cc19d617aac61b4 Mon Sep 17 00:00:00 2001 From: Andrew Morgan Date: Wed, 3 Apr 2019 11:41:28 +0100 Subject: Don't break logic when refactoring --- synapse/http/matrixfederationclient.py | 2 +- synapse/rest/key/v2/remote_key_resource.py | 2 +- synapse/rest/media/v1/media_repository.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/synapse/http/matrixfederationclient.py b/synapse/http/matrixfederationclient.py index 36d1015514..b834d06219 100644 --- a/synapse/http/matrixfederationclient.py +++ b/synapse/http/matrixfederationclient.py @@ -283,7 +283,7 @@ class MatrixFederationHttpClient(object): else: _sec_timeout = self.default_timeout - if (self.hs.config.federation_domain_whitelist and + if (self.hs.config.federation_domain_whitelist is not None and request.destination not in self.hs.config.federation_domain_whitelist): raise FederationDeniedError(request.destination) diff --git a/synapse/rest/key/v2/remote_key_resource.py b/synapse/rest/key/v2/remote_key_resource.py index 426c05e79c..5a14cfd426 100644 --- a/synapse/rest/key/v2/remote_key_resource.py +++ b/synapse/rest/key/v2/remote_key_resource.py @@ -139,7 +139,7 @@ class RemoteKey(Resource): store_queries = [] for server_name, key_ids in query.items(): - if (self.federation_domain_whitelist and + if (self.federation_domain_whitelist is not None and server_name not in self.federation_domain_whitelist): logger.debug("Federation denied with %s", server_name) continue diff --git a/synapse/rest/media/v1/media_repository.py b/synapse/rest/media/v1/media_repository.py index 8b16ceb3e9..40b10e68c0 100644 --- a/synapse/rest/media/v1/media_repository.py +++ b/synapse/rest/media/v1/media_repository.py @@ -269,7 +269,7 @@ class MediaRepository(object): Returns: Deferred[dict]: The media_info of the file """ - if (self.federation_domain_whitelist and + if (self.federation_domain_whitelist is not None and server_name not in self.federation_domain_whitelist): raise FederationDeniedError(server_name) -- cgit 1.4.1