Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Merge pull request #2714 from matrix-org/rav/revert_mxid_case_thing
Browse files Browse the repository at this point in the history
Revert "Allow upper-case characters in mxids"
  • Loading branch information
richvdh authored Nov 27, 2017
2 parents 6c9d1e8 + 39b9c83 commit ac73960
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions synapse/handlers/register.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@

"""Contains functions for registering clients."""
import logging
import urllib

from twisted.internet import defer

from synapse.api.errors import (
AuthError, Codes, SynapseError, RegistrationError, InvalidCaptchaError
)
from synapse.http.client import CaptchaServerHttpClient
from synapse import types
from synapse.types import UserID
from synapse.util.async import run_on_reactor
from ._base import BaseHandler
Expand All @@ -47,7 +47,7 @@ def __init__(self, hs):
@defer.inlineCallbacks
def check_username(self, localpart, guest_access_token=None,
assigned_user_id=None):
if urllib.quote(localpart.encode('utf-8')) != localpart:
if types.contains_invalid_mxid_characters(localpart):
raise SynapseError(
400,
"User ID can only contain characters a-z, 0-9, or '=_-./'",
Expand Down Expand Up @@ -253,7 +253,7 @@ def register_saml2(self, localpart):
"""
Registers email_id as SAML2 Based Auth.
"""
if urllib.quote(localpart) != localpart:
if types.contains_invalid_mxid_characters(localpart):
raise SynapseError(
400,
"User ID can only contain characters a-z, 0-9, or '=_-./'",
Expand Down

0 comments on commit ac73960

Please sign in to comment.