Browse Source

Require target in `call()` method

The `call` method used to allow both `to` and `sid` to be `None`, however without a target, it broadcasts to all connected clients, and can have very disastrous results in some cases.
pull/476/head
tt2468 5 years ago
committed by GitHub
parent
commit
7ec2019a3b
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      socketio/asyncio_server.py

2
socketio/asyncio_server.py

@ -209,6 +209,8 @@ class AsyncServer(server.Server):
Note 2: this method is a coroutine.
"""
if to == None and sid == None:
raise TypeError('Missing `to` or `sid`.')
if not self.async_handlers:
raise RuntimeError(
'Cannot use call() when async_handlers is False.')

Loading…
Cancel
Save