mirror of
https://github.com/onionshare/onionshare.git
synced 2024-10-01 01:35:40 -04:00
Merge branch 'main' of github.com:onionshare/onionshare-ghsa-r78w-rpvr-g57q into release-2.6.2
This commit is contained in:
commit
c0e7a4a0f4
@ -76,12 +76,16 @@ class ChatModeWeb:
|
||||
)
|
||||
|
||||
def validate_username(self, username):
|
||||
username = self.remove_unallowed_characters(username.strip())
|
||||
return (
|
||||
username
|
||||
and username not in self.connected_users
|
||||
and len(username) < 128
|
||||
)
|
||||
try:
|
||||
username = self.remove_unallowed_characters(username.strip())
|
||||
return (
|
||||
username
|
||||
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):
|
||||
"""
|
||||
@ -160,7 +164,7 @@ class ChatModeWeb:
|
||||
broadcast=True,
|
||||
)
|
||||
else:
|
||||
raise ConnectionRefusedError('You are active from another session!')
|
||||
raise ConnectionRefusedError('Invalid session')
|
||||
|
||||
@self.web.socketio.on("text", namespace="/chat")
|
||||
def text(message):
|
||||
|
Loading…
Reference in New Issue
Block a user