Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Merge pull request #3099 from matrix-org/matthew/fix-federation-domai…
Browse files Browse the repository at this point in the history
…n-whitelist

fix federation_domain_whitelist
  • Loading branch information
ara4n authored Apr 13, 2018
2 parents 25b0ba3 + 78a9698 commit 0d8c50d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions synapse/federation/transport/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,6 @@ def authenticate_request(self, request, content):
"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

Expand Down Expand Up @@ -138,6 +132,12 @@ def strip_quotes(value):
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,
Expand Down

0 comments on commit 0d8c50d

Please sign in to comment.