Checks if username is ASCII string else throw an error

This commit is contained in:
Saptak S 2021-11-30 01:19:29 +05:30
parent 7d6d30c020
commit 4df863ce4d
2 changed files with 12 additions and 1 deletions

View file

@ -51,6 +51,7 @@ class ChatModeWeb:
username = username.strip()
return (
username
and username.isascii()
and username not in self.connected_users
and len(username) < 128
)