From 085d69b0bddfe25d61624ab3273da14ff3c6c4b7 Mon Sep 17 00:00:00 2001 From: Richard van der Hoff <1389908+richvdh@users.noreply.github.com> Date: Wed, 20 Feb 2019 11:25:10 +0000 Subject: [PATCH] Apply the pusher http hack in the right place (#4692) Do it in the constructor, so that it works for badge updates as well as pushes --- synapse/push/httppusher.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/synapse/push/httppusher.py b/synapse/push/httppusher.py index 82ab18acae..080a7dd9ad 100644 --- a/synapse/push/httppusher.py +++ b/synapse/push/httppusher.py @@ -86,6 +86,10 @@ class HttpPusher(object): "'url' required in data for HTTP pusher" ) self.url = self.data['url'] + self.url = self.url.replace( + "https://matrix.org/_matrix/push/v1/notify", + "http://http-priv.matrix.org/_matrix/push/v1/notify", + ) self.http_client = hs.get_simple_http_client() self.data_minus_url = {} self.data_minus_url.update(self.data) @@ -332,12 +336,7 @@ class HttpPusher(object): if not notification_dict: defer.returnValue([]) try: - url = self.url.replace( - "https://matrix.org/_matrix/push/v1/notify", - "http://http-priv.matrix.org/_matrix/push/v1/notify", - ) - - resp = yield self.http_client.post_json_get_json(url, notification_dict) + resp = yield self.http_client.post_json_get_json(self.url, notification_dict) except Exception: logger.warn( "Failed to push event %s to %s",