From a36f59f50ed775530b06a5ca1e7da22b674f1f13 Mon Sep 17 00:00:00 2001 From: Nyholm Date: Mon, 30 Jul 2018 02:59:15 -0700 Subject: [PATCH] Verify that Kernel is terminatable. --- phpfastcgi/fastcgi-daemon/1.0/src/FastCGIKernel.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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; }