diff options
author | Richard van der Hoff <1389908+richvdh@users.noreply.github.com> | 2019-01-17 12:40:09 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-17 12:40:09 +0000 |
commit | 9feb5d0b71104bea4e366d451d5dddd447e16196 (patch) | |
tree | c5d37bfa94ac65ffce4590eaa663da85755283d2 /synapse/handlers | |
parent | Changing macaroon_secret_key no longer logs you out (#4387) (diff) | |
download | synapse-9feb5d0b71104bea4e366d451d5dddd447e16196.tar.xz |
sign_request -> build_auth_headers (#4408)
Just got very confused about the fact that the headers are only an output, not an input.
Diffstat (limited to 'synapse/handlers')
-rw-r--r-- | synapse/handlers/identity.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/synapse/handlers/identity.py b/synapse/handlers/identity.py index 5feb3f22a6..39184f0e22 100644 --- a/synapse/handlers/identity.py +++ b/synapse/handlers/identity.py @@ -167,18 +167,21 @@ class IdentityHandler(BaseHandler): "mxid": mxid, "threepid": threepid, } - headers = {} + # we abuse the federation http client to sign the request, but we have to send it # using the normal http client since we don't want the SRV lookup and want normal # 'browser-like' HTTPS. - self.federation_http_client.sign_request( + auth_headers = self.federation_http_client.build_auth_headers( destination=None, method='POST', url_bytes='/_matrix/identity/api/v1/3pid/unbind'.encode('ascii'), - headers_dict=headers, content=content, destination_is=id_server, ) + headers = { + b"Authorization": auth_headers, + } + try: yield self.http_client.post_json_get_json( url, |