mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2024-10-01 11:49:51 -04:00
Add same user_id char checks as registration.
This commit is contained in:
parent
cf1fa59f4b
commit
5e88a09a42
@ -13,6 +13,7 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
import logging
|
||||
import urllib
|
||||
import yaml
|
||||
from simplejson import JSONDecodeError
|
||||
import simplejson as json
|
||||
@ -209,7 +210,12 @@ class ApplicationServiceStore(SQLBaseStore):
|
||||
if not isinstance(as_info.get(field), basestring):
|
||||
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()
|
||||
|
||||
# namespace checks
|
||||
|
Loading…
Reference in New Issue
Block a user