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 97fe219e21
commit 98f6f3b7d7
No known key found for this signature in database
GPG key ID: 7B7F1772C0C6FCBF
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
)