diff options
author | Michael Kaye <1917473+michaelkaye@users.noreply.github.com> | 2019-01-28 14:24:28 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-28 14:24:28 +0000 |
commit | 2712a9ef8f5222543614b590ef5a29a674c3c723 (patch) | |
tree | 51d2fb8d6bf5366e001eab6d56faa24c69316472 /synapse/handlers/identity.py | |
parent | Rewrite identity server URLs as required. (#4393) (diff) | |
download | synapse-2712a9ef8f5222543614b590ef5a29a674c3c723.tar.xz |
Fix to keep the signature valid for the request. (#4480) dinsic_2019-01-28
Diffstat (limited to 'synapse/handlers/identity.py')
-rw-r--r-- | synapse/handlers/identity.py | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/synapse/handlers/identity.py b/synapse/handlers/identity.py index 3ffdb45bef..6255d3ffed 100644 --- a/synapse/handlers/identity.py +++ b/synapse/handlers/identity.py @@ -169,12 +169,6 @@ class IdentityHandler(BaseHandler): # deletion request to. id_server = next(iter(self.trusted_id_servers)) - # if we have a rewrite rule set for the identity server, - # apply it now. - if id_server in self.rewrite_identity_server_urls: - id_server = self.rewrite_identity_server_urls[id_server] - - url = "https://%s/_matrix/identity/api/v1/3pid/unbind" % (id_server,) content = { "mxid": mxid, "threepid": threepid, @@ -191,6 +185,15 @@ class IdentityHandler(BaseHandler): content=content, destination_is=id_server, ) + # if we have a rewrite rule set for the identity server, + # apply it now. + # + # Note that destination_is has to be the real id_server, not + # the server we connect to. + if id_server in self.rewrite_identity_server_urls: + id_server = self.rewrite_identity_server_urls[id_server] + + url = "https://%s/_matrix/identity/api/v1/3pid/unbind" % (id_server,) try: yield self.http_client.post_json_get_json( url, |