mirror of
https://github.com/onionshare/onionshare.git
synced 2024-10-01 01:35:40 -04:00
Handle exceptions in chat mode's validate_username
This commit is contained in:
parent
fe7bd43f04
commit
3ef52eb59b
@ -48,6 +48,7 @@ class ChatModeWeb:
|
||||
self.define_routes()
|
||||
|
||||
def validate_username(self, username):
|
||||
try:
|
||||
username = username.strip()
|
||||
return (
|
||||
username
|
||||
@ -55,6 +56,9 @@ class ChatModeWeb:
|
||||
and username not in self.connected_users
|
||||
and len(username) < 128
|
||||
)
|
||||
except Exception as e:
|
||||
self.common.log("ChatModeWeb", "validate_username", e)
|
||||
return False
|
||||
|
||||
def define_routes(self):
|
||||
"""
|
||||
|
Loading…
Reference in New Issue
Block a user