Only allow bytes thru websocket
This commit is contained in:
parent
dc98b5e6d5
commit
2abf9fd7f0
|
@ -134,8 +134,10 @@ async def handle(ws, path):
|
|||
await subscribe_flight(struct.pack(b"<I?", int(path), True))
|
||||
while not cli.ws.closed:
|
||||
async for data in cli.ws:
|
||||
#data = data.encode() # For some reason or another... websockets module returns a string instead of bytes?
|
||||
await query(data)
|
||||
if type(data) != bytes:
|
||||
await send_error(b"Bytes are required")
|
||||
else:
|
||||
await query(data)
|
||||
|
||||
await asyncio.sleep(.1)
|
||||
finally:
|
||||
|
|
Loading…
Reference in New Issue
Block a user