From a9a5329a1166e13ec490ef239d94b2dcc51f5d72 Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Sun, 24 Aug 2014 11:28:00 +0100 Subject: Encode unicode from json as utf-8. This was required to allow people to register on my laptop --- synapse/rest/register.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'synapse/rest/register.py') diff --git a/synapse/rest/register.py b/synapse/rest/register.py index eb457562b9..f17ec11cf4 100644 --- a/synapse/rest/register.py +++ b/synapse/rest/register.py @@ -33,10 +33,10 @@ class RegisterRestServlet(RestServlet): try: register_json = json.loads(request.content.read()) if "password" in register_json: - password = register_json["password"] + password = register_json["password"].encode("utf-8") if type(register_json["user_id"]) == unicode: - desired_user_id = register_json["user_id"] + desired_user_id = register_json["user_id"].encode("utf-8") if urllib.quote(desired_user_id) != desired_user_id: raise SynapseError( 400, -- cgit 1.4.1