diff --git a/src/calibre/srv/web_socket.py b/src/calibre/srv/web_socket.py index 7314e31a81..d37ccba535 100644 --- a/src/calibre/srv/web_socket.py +++ b/src/calibre/srv/web_socket.py @@ -320,7 +320,7 @@ class WebSocketConnection(HTTPConnection): self.websocket_close(PROTOCOL_ERROR, 'Continuation frame without any message to continue') return self.current_recv_opcode = opcode - elif opcode != CONTINUATION: + elif frame_starting and opcode != CONTINUATION: self.log.error('Client sent continuation frame with non-zero opcode') self.websocket_close(PROTOCOL_ERROR, 'Continuation frame with non-zero opcode') return