Open cacosandon opened 2 months ago
When using uvicorn or daphne, only one of text or bytes is sent.
uvicorn
daphne
text
bytes
But on hypercorn, both of them are sent, but with None value: https://github.com/pgjones/hypercorn/blob/31639ec2f4d03aa920b95c84686163901224c6cf/src/hypercorn/protocol/ws_stream.py#L159
hypercorn
None
So if you just send bytes, text will be None and you won't be able to handle the message.
I just add an extra check.
When using
uvicorn
ordaphne
, only one oftext
orbytes
is sent.But on
hypercorn
, both of them are sent, but withNone
value: https://github.com/pgjones/hypercorn/blob/31639ec2f4d03aa920b95c84686163901224c6cf/src/hypercorn/protocol/ws_stream.py#L159So if you just send
bytes
,text
will beNone
and you won't be able to handle the message.I just add an extra check.