Skip to content

Commit 89583e7

Browse files
committed
enable HTTP method overrides as early as possible with the HTTP cache
1 parent b7b69d5 commit 89583e7

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

HttpCache/HttpCache.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
use Symfony\Component\HttpKernel\HttpCache\Store;
1919
use Symfony\Component\HttpKernel\HttpCache\StoreInterface;
2020
use Symfony\Component\HttpKernel\HttpCache\SurrogateInterface;
21+
use Symfony\Component\HttpKernel\HttpKernelInterface;
2122
use Symfony\Component\HttpKernel\KernelInterface;
2223

2324
/**
@@ -62,6 +63,15 @@ public function __construct(KernelInterface $kernel, $cache = null, SurrogateInt
6263
parent::__construct($kernel, $this->createStore(), $this->createSurrogate(), array_merge($this->options, $this->getOptions()));
6364
}
6465

66+
public function handle(Request $request, int $type = HttpKernelInterface::MASTER_REQUEST, bool $catch = true)
67+
{
68+
if ($this->kernel->getContainer()->getParameter('kernel.http_method_override')) {
69+
Request::enableHttpMethodParameterOverride();
70+
}
71+
72+
return parent::handle($request, $type, $catch);
73+
}
74+
6575
/**
6676
* {@inheritdoc}
6777
*/

0 commit comments

Comments
 (0)