diff --git a/sanic/server/protocols/websocket_protocol.py b/sanic/server/protocols/websocket_protocol.py index beee1d26..5a3e70f2 100644 --- a/sanic/server/protocols/websocket_protocol.py +++ b/sanic/server/protocols/websocket_protocol.py @@ -147,7 +147,7 @@ class WebSocketProtocol(HttpProtocol): "".join([f"{k}: {v}\r\n" for k, v in resp.headers.items()]) ).encode() rbody += b"\r\n" - if resp.body is not None: + if resp.body: rbody += resp.body rbody += b"\r\n\r\n" await super().send(rbody)