summary refs log tree commit diff
path: root/synapse/push
diff options
context:
space:
mode:
authorRichard van der Hoff <1389908+richvdh@users.noreply.github.com>2019-02-20 11:25:10 +0000
committerGitHub <noreply@github.com>2019-02-20 11:25:10 +0000
commit085d69b0bddfe25d61624ab3273da14ff3c6c4b7 (patch)
tree9dc209e2ff3f76b759c3a2d9143e62427525ed5a /synapse/push
parentMerge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes (diff)
downloadsynapse-085d69b0bddfe25d61624ab3273da14ff3c6c4b7.tar.xz
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
Diffstat (limited to 'synapse/push')
-rw-r--r--synapse/push/httppusher.py11
1 files 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",