Skip to content
Snippets Groups Projects
Commit 5e88a09a authored by Kegan Dougal's avatar Kegan Dougal
Browse files

Add same user_id char checks as registration.

parent cf1fa59f
No related branches found
No related tags found
No related merge requests found
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
import logging import logging
import urllib
import yaml import yaml
from simplejson import JSONDecodeError from simplejson import JSONDecodeError
import simplejson as json import simplejson as json
...@@ -209,7 +210,12 @@ class ApplicationServiceStore(SQLBaseStore): ...@@ -209,7 +210,12 @@ class ApplicationServiceStore(SQLBaseStore):
if not isinstance(as_info.get(field), basestring): if not isinstance(as_info.get(field), basestring):
raise KeyError("Required string field: '%s'", field) raise KeyError("Required string field: '%s'", field)
user = UserID(as_info["sender_localpart"], self.hostname) localpart = as_info["sender_localpart"]
if urllib.quote(localpart) != localpart:
raise ValueError(
"sender_localpart needs characters which are not URL encoded."
)
user = UserID(localpart, self.hostname)
user_id = user.to_string() user_id = user.to_string()
# namespace checks # namespace checks
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment