diff --git a/phpfastcgi/fastcgi-daemon/1.0/src/FastCGIKernel.php b/phpfastcgi/fastcgi-daemon/1.0/src/FastCGIKernel.php index 632c65d8..9085941b 100644 --- a/phpfastcgi/fastcgi-daemon/1.0/src/FastCGIKernel.php +++ b/phpfastcgi/fastcgi-daemon/1.0/src/FastCGIKernel.php @@ -5,6 +5,7 @@ namespace App; use PHPFastCGI\FastCGIDaemon\Http\RequestInterface; use PHPFastCGI\FastCGIDaemon\KernelInterface; use Symfony\Component\HttpKernel\HttpKernelInterface; +use Symfony\Component\HttpKernel\TerminableInterface; class FastCGIKernel implements KernelInterface { @@ -18,9 +19,11 @@ class FastCGIKernel implements KernelInterface public function handleRequest(RequestInterface $request) { $symfonyRequest = $request->getHttpFoundationRequest(); - $symfonyResponse = $this->kernel->handle($symfonyRequest); - $this->kernel->terminate($symfonyRequest, $symfonyResponse); + + if ($this->kernel instanceof TerminableInterface) { + $this->kernel->terminate($symfonyRequest, $symfonyResponse); + } return $symfonyResponse; }