Allow URL-encoded user IDs on user admin api paths (#6825)

This commit is contained in:
Andrew Morgan 2020-02-03 13:18:42 +00:00 committed by GitHub
parent b0d112e78b
commit 370080531e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

1
changelog.d/6825.bugfix Normal file
View file

@ -0,0 +1 @@
Allow URL-encoded User IDs on `/_synapse/admin/v2/users/<user_id>[/admin]` endpoints. Thanks to @NHAS for reporting.

View file

@ -105,7 +105,7 @@ class UsersRestServletV2(RestServlet):
class UserRestServletV2(RestServlet):
PATTERNS = (re.compile("^/_synapse/admin/v2/users/(?P<user_id>@[^/]+)$"),)
PATTERNS = (re.compile("^/_synapse/admin/v2/users/(?P<user_id>[^/]+)$"),)
"""Get request to list user details.
This needs user to have administrator access in Synapse.
@ -568,7 +568,7 @@ class UserAdminServlet(RestServlet):
{}
"""
PATTERNS = (re.compile("^/_synapse/admin/v1/users/(?P<user_id>@[^/]*)/admin$"),)
PATTERNS = (re.compile("^/_synapse/admin/v1/users/(?P<user_id>[^/]*)/admin$"),)
def __init__(self, hs):
self.hs = hs