mirror of
https://github.com/onionshare/onionshare.git
synced 2025-01-10 03:37:28 -03:00
Handle exceptions in chat mode's validate_username
This commit is contained in:
parent
fe7bd43f04
commit
3ef52eb59b
1 changed files with 11 additions and 7 deletions
|
@ -48,6 +48,7 @@ class ChatModeWeb:
|
||||||
self.define_routes()
|
self.define_routes()
|
||||||
|
|
||||||
def validate_username(self, username):
|
def validate_username(self, username):
|
||||||
|
try:
|
||||||
username = username.strip()
|
username = username.strip()
|
||||||
return (
|
return (
|
||||||
username
|
username
|
||||||
|
@ -55,6 +56,9 @@ class ChatModeWeb:
|
||||||
and username not in self.connected_users
|
and username not in self.connected_users
|
||||||
and len(username) < 128
|
and len(username) < 128
|
||||||
)
|
)
|
||||||
|
except Exception as e:
|
||||||
|
self.common.log("ChatModeWeb", "validate_username", e)
|
||||||
|
return False
|
||||||
|
|
||||||
def define_routes(self):
|
def define_routes(self):
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in a new issue