summary refs log tree commit diff
path: root/synapse/rest/consent/consent_resource.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/consent/consent_resource.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/consent/consent_resource.py')
-rw-r--r--synapse/rest/consent/consent_resource.py10
1 files changed, 3 insertions, 7 deletions
diff --git a/synapse/rest/consent/consent_resource.py b/synapse/rest/consent/consent_resource.py
index 049c16b236..0a890c98cb 100644
--- a/synapse/rest/consent/consent_resource.py
+++ b/synapse/rest/consent/consent_resource.py
@@ -28,7 +28,7 @@ from synapse.api.errors import NotFoundError, StoreError, SynapseError
 from synapse.config import ConfigError
 from synapse.http.server import (
     DirectServeResource,
-    finish_request,
+    respond_with_html,
     wrap_html_request_handler,
 )
 from synapse.http.servlet import parse_string
@@ -196,12 +196,8 @@ class ConsentResource(DirectServeResource):
         template_html = self._jinja_env.get_template(
             path.join(TEMPLATE_LANGUAGE, template_name)
         )
-        html_bytes = template_html.render(**template_args).encode("utf8")
-
-        request.setHeader(b"Content-Type", b"text/html; charset=utf-8")
-        request.setHeader(b"Content-Length", b"%i" % len(html_bytes))
-        request.write(html_bytes)
-        finish_request(request)
+        html = template_html.render(**template_args)
+        respond_with_html(request, 200, html)
 
     def _check_hash(self, userid, userhmac):
         """