move bytes decoding to serializer

This commit is contained in:
Timothy Pogue
2022-09-05 23:25:25 -06:00
parent d526dfb171
commit 38f14349e9
2 changed files with 3 additions and 10 deletions

View File

@@ -27,12 +27,6 @@ class WebSocketProxy:
"""
Send data on the wrapped websocket
"""
if not isinstance(data, str):
# We use HybridJSONWebSocketSerializer, which when serialized returns
# bytes because of ORJSON, so we explicitly decode into a string
data = str(data, "utf-8")
if hasattr(self._websocket, "send_text"):
await self._websocket.send_text(data)
else: