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:
Griatch 2016-06-02 09:03:18 +02:00
parent 7870d21b00
commit fd5ed02d7a

View file

@ -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: