diff options
author | Erik Johnston <erik@matrix.org> | 2015-03-20 16:31:48 +0000 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2015-03-20 16:31:48 +0000 |
commit | f6583796feeff5a50c0988ce674a1ab861b14e34 (patch) | |
tree | 47f9d5934440eef201c6ab65a0fb8df06631d18d /synapse/handlers | |
parent | Rearrange storage modules (diff) | |
parent | Merge pull request #113 from matrix-org/store_rearrangement (diff) | |
download | synapse-f6583796feeff5a50c0988ce674a1ab861b14e34.tar.xz |
Merge branch 'develop' of github.com:matrix-org/synapse into mysql
Diffstat (limited to 'synapse/handlers')
-rw-r--r-- | synapse/handlers/federation.py | 2 | ||||
-rw-r--r-- | synapse/handlers/register.py | 8 |
2 files changed, 10 insertions, 0 deletions
diff --git a/synapse/handlers/federation.py b/synapse/handlers/federation.py index 65cfacba2e..15ba417e06 100644 --- a/synapse/handlers/federation.py +++ b/synapse/handlers/federation.py @@ -290,6 +290,8 @@ class FederationHandler(BaseHandler): """ logger.debug("Joining %s to %s", joinee, room_id) + yield self.store.clean_room_for_join(room_id) + origin, pdu = yield self.replication_layer.make_join( target_hosts, room_id, diff --git a/synapse/handlers/register.py b/synapse/handlers/register.py index cda4a8502a..c25e321099 100644 --- a/synapse/handlers/register.py +++ b/synapse/handlers/register.py @@ -31,6 +31,7 @@ import base64 import bcrypt import json import logging +import urllib logger = logging.getLogger(__name__) @@ -63,6 +64,13 @@ class RegistrationHandler(BaseHandler): password_hash = bcrypt.hashpw(password, bcrypt.gensalt()) if localpart: + if localpart and urllib.quote(localpart) != localpart: + raise SynapseError( + 400, + "User ID must only contain characters which do not" + " require URL encoding." + ) + user = UserID(localpart, self.hs.hostname) user_id = user.to_string() |