From 1147ce7e18d44c6c4833516deef923c5085b0574 Mon Sep 17 00:00:00 2001 From: David Baker Date: Thu, 12 Apr 2018 17:59:37 +0100 Subject: [PATCH] Include origin_server in the sig! Also be consistent with underscores --- synapse/handlers/profile.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/synapse/handlers/profile.py b/synapse/handlers/profile.py index 5ba6c257c..454f828d4 100644 --- a/synapse/handlers/profile.py +++ b/synapse/handlers/profile.py @@ -89,19 +89,20 @@ class ProfileHandler(BaseHandler): batch_rows = yield self.store.get_profile_batch(batchnum) batch = { UserID(r["user_id"], self.hs.hostname).to_string(): { - "displayname": r["displayname"], + "display_name": r["displayname"], "avatar_url": r["avatar_url"], } for r in batch_rows } url = "https://%s/_matrix/federation/v1/replicate_profiles" % (host,) - signed_batch = { + body = { "batchnum": batchnum, - "signed_batch": sign_json(batch, self.hs.hostname, self.hs.config.signing_key[0]), + "batch": batch, "origin_server": self.hs.hostname, } + signed_body = sign_json(body, self.hs.hostname, self.hs.config.signing_key[0]) try: - yield self.http_client.post_json_get_json(url, signed_batch) + yield self.http_client.post_json_get_json(url, signed_body) self.store.update_replication_batch_for_host(host, batchnum) logger.info("Sucessfully replicated profile batch %d to %s", batchnum, host) except: