8000 enable HTTP method overrides ASAP when using the HTTP cache · symfony/symfony@350e78a · GitHub
[go: up one dir, main page]

Skip to content

Commit 350e78a

Browse files
committed
enable HTTP method overrides ASAP when using the HTTP cache
1 parent 4b312ab commit 350e78a

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/Symfony/Bundle/FrameworkBundle/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)
0