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

Commit

Permalink
Fix to keep the signature valid for the request. (#4480)
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelkaye authored Jan 28, 2019
1 parent da757b7 commit 2712a9e
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions synapse/handlers/identity.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,12 +169,6 @@ def try_unbind_threepid(self, mxid, threepid):
# 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,
Expand All @@ -191,6 +185,15 @@ def try_unbind_threepid(self, mxid, threepid):
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,
Expand Down

0 comments on commit 2712a9e

Please sign in to comment.