Verify that Kernel is terminatable.

This commit is contained in:
Nyholm
2018-07-30 02:59:15 -07:00
parent 2b191f5904
commit a36f59f50e
@@ -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;
}