fix: can send Json even if Flight is not started yet

pull/643/head
Pierre Clavequin 2 weeks ago
parent 0abf1b9b16
commit 8af8c53959

@ -913,7 +913,11 @@ class Engine
->status($code) ->status($code)
->header('Content-Type', 'application/json') ->header('Content-Type', 'application/json')
->write($json); ->write($json);
if ($this->response()->v2_output_buffering === true) {
if (
$this->response()->v2_output_buffering === true
|| ($this->requestHandled === false && empty(getenv('PHPUNIT_TEST')))
) {
$this->response()->send(); $this->response()->send();
} }
} }

Loading…
Cancel
Save