diff options
author | Matthew Hodgson <matthew@arasphere.net> | 2018-04-13 15:51:13 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-13 15:51:13 +0100 |
commit | 0d8c50df4438ba6460e17caee7b9c87f36028944 (patch) | |
tree | f5f485ad79d6897f42279dad6ad2715df14df477 /synapse/federation | |
parent | revert last to PR properly (diff) | |
parent | fix federation_domain_whitelist (diff) | |
download | synapse-0d8c50df4438ba6460e17caee7b9c87f36028944.tar.xz |
Merge pull request #3099 from matrix-org/matthew/fix-federation-domain-whitelist
fix federation_domain_whitelist
Diffstat (limited to 'synapse/federation')
-rw-r--r-- | synapse/federation/transport/server.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/synapse/federation/transport/server.py b/synapse/federation/transport/server.py index 4c94d5a36c..ff0656df3e 100644 --- a/synapse/federation/transport/server.py +++ b/synapse/federation/transport/server.py @@ -94,12 +94,6 @@ class Authenticator(object): "signatures": {}, } - if ( - self.federation_domain_whitelist is not None and - self.server_name not in self.federation_domain_whitelist - ): - raise FederationDeniedError(self.server_name) - if content is not None: json_request["content"] = content @@ -138,6 +132,12 @@ class Authenticator(object): json_request["origin"] = origin json_request["signatures"].setdefault(origin, {})[key] = sig + if ( + self.federation_domain_whitelist is not None and + origin not in self.federation_domain_whitelist + ): + raise FederationDeniedError(origin) + if not json_request["signatures"]: raise NoAuthenticationError( 401, "Missing Authorization headers", Codes.UNAUTHORIZED, |