diff --git a/src/Igorw/EventSource/EchoHandler.php b/src/Igorw/EventSource/EchoHandler.php index f5fd6bf..8db87bf 100644 --- a/src/Igorw/EventSource/EchoHandler.php +++ b/src/Igorw/EventSource/EchoHandler.php @@ -16,7 +16,7 @@ class EchoHandler public function __invoke($chunk) { echo $chunk; - ob_flush(); + if (ob_get_level() > 0) ob_flush(); flush(); } }