1
0

Revert "Merge pull request #5932 from matrix-org/babolivier/account_validity_template_encode"

This reverts commit 84e695f506, reversing
changes made to 99eec6d2d5.
This commit is contained in:
Brendan Abolivier
2019-09-09 16:36:00 +01:00
parent 21a6f0b12c
commit 76f70779f1
3 changed files with 4 additions and 7 deletions

View File

@@ -67,7 +67,7 @@ REQUIREMENTS = [
"pymacaroons>=0.13.0",
"msgpack>=0.5.0",
"phonenumbers>=8.2.0",
"six>=1.12",
"six>=1.10",
# prometheus_client 0.4.0 changed the format of counter metrics
# (cf https://github.com/matrix-org/synapse/issues/4001)
"prometheus_client>=0.0.18,<0.4.0",

View File

@@ -15,8 +15,6 @@
import logging
from six import ensure_binary
from twisted.internet import defer
from synapse.api.errors import AuthError, SynapseError
@@ -65,7 +63,7 @@ class AccountValidityRenewServlet(RestServlet):
request.setResponseCode(status_code)
request.setHeader(b"Content-Type", b"text/html; charset=utf-8")
request.setHeader(b"Content-Length", b"%d" % (len(response),))
request.write(ensure_binary(response))
request.write(response.encode("utf8"))
finish_request(request)
defer.returnValue(None)

View File

@@ -20,7 +20,6 @@ import json
import os
from mock import Mock
from six import ensure_binary
import pkg_resources
@@ -438,7 +437,7 @@ class AccountValidityRenewalByEmailTestCase(unittest.HomeserverTestCase):
# Check that the HTML we're getting is the one we expect on a successful renewal.
expected_html = self.hs.config.account_validity.account_renewed_html_content
self.assertEqual(
channel.result["body"], ensure_binary(expected_html), channel.result
channel.result["body"], expected_html.encode("utf8"), channel.result
)
# Move 3 days forward. If the renewal failed, every authed request with
@@ -468,7 +467,7 @@ class AccountValidityRenewalByEmailTestCase(unittest.HomeserverTestCase):
# invalid/unknown token.
expected_html = self.hs.config.account_validity.invalid_token_html_content
self.assertEqual(
channel.result["body"], ensure_binary(expected_html), channel.result
channel.result["body"], expected_html.encode("utf8"), channel.result
)
def test_manual_email_send(self):