diff --git a/docs/usage/websockets.rst b/docs/usage/websockets.rst index 0450ace8ee..dc9dc7eeb5 100644 --- a/docs/usage/websockets.rst +++ b/docs/usage/websockets.rst @@ -386,4 +386,4 @@ send data in any format, independently of the mode. The mode only affects how th bytes are handled during transport (i.e. on the protocol level). In most cases the default mode - ``text`` - is all that's needed. Binary transport is usually employed when sending binary blobs that don't have a meaningful string representation, such -as images. \ No newline at end of file +as images. diff --git a/litestar/handlers/websocket_handlers/stream.py b/litestar/handlers/websocket_handlers/stream.py index c4e689b4e7..506cfdc888 100644 --- a/litestar/handlers/websocket_handlers/stream.py +++ b/litestar/handlers/websocket_handlers/stream.py @@ -261,9 +261,7 @@ def on_registration(self, app: Litestar) -> None: return_dto = self.resolve_return_dto() # make sure the closure doesn't capture self._ws_stream / self - send_mode = cast( # pyright doesn't track the 'Literal' here for some reason - "WebSocketMode", self._ws_stream_options.send_mode - ) + send_mode = self._ws_stream_options.send_mode listen_for_disconnect = self._ws_stream_options.listen_for_disconnect warn_on_data_discard = self._ws_stream_options.warn_on_data_discard