diff --git a/src/Klein/Klein.php b/src/Klein/Klein.php index 587379fd..feadaf9c 100644 --- a/src/Klein/Klein.php +++ b/src/Klein/Klein.php @@ -690,10 +690,6 @@ public function dispatch( while (ob_get_level() >= $this->output_buffer_level) { ob_end_clean(); } - } elseif (self::DISPATCH_NO_CAPTURE === $capture) { - while (ob_get_level() >= $this->output_buffer_level) { - ob_end_flush(); - } } } catch (LockedResponseException $e) { // Do nothing, since this is an automated behavior @@ -705,6 +701,12 @@ public function dispatch( if ($send_response && !$this->response->isSent()) { $this->response->send(); } + + if (self::DISPATCH_NO_CAPTURE === $capture) { + while (ob_get_level() >= $this->output_buffer_level) { + ob_end_flush(); + } + } } /**