enable HTTP method overrides as early as possible with the HTTP cache
This commit is contained in:
parent
e3788b68be
commit
93e9337382
@ -18,6 +18,7 @@ use Symfony\Component\HttpKernel\HttpCache\HttpCache as BaseHttpCache;
|
|||||||
use Symfony\Component\HttpKernel\HttpCache\Store;
|
use Symfony\Component\HttpKernel\HttpCache\Store;
|
||||||
use Symfony\Component\HttpKernel\HttpCache\StoreInterface;
|
use Symfony\Component\HttpKernel\HttpCache\StoreInterface;
|
||||||
use Symfony\Component\HttpKernel\HttpCache\SurrogateInterface;
|
use Symfony\Component\HttpKernel\HttpCache\SurrogateInterface;
|
||||||
|
use Symfony\Component\HttpKernel\HttpKernelInterface;
|
||||||
use Symfony\Component\HttpKernel\KernelInterface;
|
use Symfony\Component\HttpKernel\KernelInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -62,6 +63,15 @@ class HttpCache extends BaseHttpCache
|
|||||||
parent::__construct($kernel, $this->createStore(), $this->createSurrogate(), array_merge($this->options, $this->getOptions()));
|
parent::__construct($kernel, $this->createStore(), $this->createSurrogate(), array_merge($this->options, $this->getOptions()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function handle(Request $request, int $type = HttpKernelInterface::MASTER_REQUEST, bool $catch = true)
|
||||||
|
{
|
||||||
|
if ($this->kernel->getContainer()->getParameter('kernel.http_method_override')) {
|
||||||
|
Request::enableHttpMethodParameterOverride();
|
||||||
|
}
|
||||||
|
|
||||||
|
return parent::handle($request, $type, $catch);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
|
Reference in New Issue
Block a user