Add validation to WebSocket endpoint