Don't traceback if webclient don't pass the browser session with the wsurl, to make it easier on custom client implementations.
This commit is contained in:
parent
7870d21b00
commit
fd5ed02d7a
1 changed files with 13 additions and 7 deletions
|
|
@ -62,7 +62,13 @@ class WebSocketClient(Protocol, Session):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
try:
|
||||||
self.csessid = self.transport.location.split("?", 1)[1]
|
self.csessid = self.transport.location.split("?", 1)[1]
|
||||||
|
except IndexError:
|
||||||
|
# this may happen for custom webclients not caring for the
|
||||||
|
# browser session.
|
||||||
|
self.csessid = None
|
||||||
|
if self.csessid:
|
||||||
csession = _CLIENT_SESSIONS(session_key=self.csessid)
|
csession = _CLIENT_SESSIONS(session_key=self.csessid)
|
||||||
uid = csession and csession.get("logged_in", False)
|
uid = csession and csession.get("logged_in", False)
|
||||||
if uid:
|
if uid:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue