Browse Source

fix: the logic for getting the handler

pull/1316/head
Champgy 1 year ago
parent
commit
b0afcc82ee
  1. 4
      src/socketio/base_server.py

4
src/socketio/base_server.py

@ -226,7 +226,7 @@ class BaseServer:
'*' in self.handlers[namespace]: '*' in self.handlers[namespace]:
handler = self.handlers[namespace]['*'] handler = self.handlers[namespace]['*']
args = (event, *args) args = (event, *args)
elif '*' in self.handlers: if handler is None and '*' in self.handlers:
if event in self.handlers['*']: if event in self.handlers['*']:
handler = self.handlers['*'][event] handler = self.handlers['*'][event]
args = (namespace, *args) args = (namespace, *args)
@ -245,7 +245,7 @@ class BaseServer:
handler = None handler = None
if namespace in self.namespace_handlers: if namespace in self.namespace_handlers:
handler = self.namespace_handlers[namespace] handler = self.namespace_handlers[namespace]
elif '*' in self.namespace_handlers: if handler is None and '*' in self.namespace_handlers:
handler = self.namespace_handlers['*'] handler = self.namespace_handlers['*']
args = (namespace, *args) args = (namespace, *args)
return handler, args return handler, args

Loading…
Cancel
Save