summary refs log tree commit diff
path: root/synapse/rest
diff options
context:
space:
mode:
authorAdrian Tschira <nota@notafile.com>2018-04-03 20:41:21 +0200
committerAdrian Tschira <nota@notafile.com>2018-04-04 13:48:51 +0200
commit616835187702a0c6f16042e3efb452e1ee3e7826 (patch)
tree88e4de3798a90b18fb2dbe572ba362aa8eaab3c4 /synapse/rest
parentMerge pull request #3049 from matrix-org/rav/use_staticjson (diff)
downloadsynapse-616835187702a0c6f16042e3efb452e1ee3e7826.tar.xz
Add b prefixes to some strings that are bytes in py3
This has no effect on python2

Signed-off-by: Adrian Tschira <nota@notafile.com>
Diffstat (limited to 'synapse/rest')
-rw-r--r--synapse/rest/client/v1/register.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/synapse/rest/client/v1/register.py b/synapse/rest/client/v1/register.py
index 5c5fa8f7ab..8a82097178 100644
--- a/synapse/rest/client/v1/register.py
+++ b/synapse/rest/client/v1/register.py
@@ -348,9 +348,9 @@ class RegisterRestServlet(ClientV1RestServlet):
         admin = register_json.get("admin", None)
 
         # Its important to check as we use null bytes as HMAC field separators
-        if "\x00" in user:
+        if b"\x00" in user:
             raise SynapseError(400, "Invalid user")
-        if "\x00" in password:
+        if b"\x00" in password:
             raise SynapseError(400, "Invalid password")
 
         # str() because otherwise hmac complains that 'unicode' does not