summary refs log tree commit diff
path: root/synapse/rest/client/v1/pusher.py
diff options
context:
space:
mode:
authorPatrick Cloke <patrickc@matrix.org>2020-07-02 11:01:47 -0400
committerPatrick Cloke <patrickc@matrix.org>2020-07-02 11:02:42 -0400
commitf2bcc6ecbfcb5e9486e3ab53dd41fd458d61587f (patch)
treed9f3c46ff7f20b373ee6b74562a8657718eea9ae /synapse/rest/client/v1/pusher.py
parentFix new metric where we used ms instead of seconds (#7771) (diff)
parentMerge tag 'v1.15.2' (diff)
downloadsynapse-f2bcc6ecbfcb5e9486e3ab53dd41fd458d61587f.tar.xz
Merge branch 'master' into release-v1.16.0
Diffstat (limited to 'synapse/rest/client/v1/pusher.py')
-rw-r--r--synapse/rest/client/v1/pusher.py10
1 files changed, 3 insertions, 7 deletions
diff --git a/synapse/rest/client/v1/pusher.py b/synapse/rest/client/v1/pusher.py
index 550a2f1b44..5f65cb7d83 100644
--- a/synapse/rest/client/v1/pusher.py
+++ b/synapse/rest/client/v1/pusher.py
@@ -16,7 +16,7 @@
 import logging
 
 from synapse.api.errors import Codes, StoreError, SynapseError
-from synapse.http.server import finish_request
+from synapse.http.server import respond_with_html_bytes
 from synapse.http.servlet import (
     RestServlet,
     assert_params_in_dict,
@@ -177,13 +177,9 @@ class PushersRemoveRestServlet(RestServlet):
 
         self.notifier.on_new_replication_data()
 
-        request.setResponseCode(200)
-        request.setHeader(b"Content-Type", b"text/html; charset=utf-8")
-        request.setHeader(
-            b"Content-Length", b"%d" % (len(PushersRemoveRestServlet.SUCCESS_HTML),)
+        respond_with_html_bytes(
+            request, 200, PushersRemoveRestServlet.SUCCESS_HTML,
         )
-        request.write(PushersRemoveRestServlet.SUCCESS_HTML)
-        finish_request(request)
         return None
 
     def on_OPTIONS(self, _):