Skip to content

Commit 29d1471

Browse files
committed
Merge branch '6.4' into 7.1
* 6.4: remove custom CSV escape character from tests [HttpKernel] ESI fragment content may be missing in conditional requests [SecurityBundle] Revert adding `_stateless` attribute to the request when firewall is stateless and the attribute is not already set fix compatibility with Twig 3.12 and 4.0 Improve and add tests for Last-Modified computation with ESI responses
2 parents 4f77a89 + 6170f87 commit 29d1471

File tree

2 files changed

+3
-10
lines changed

2 files changed

+3
-10
lines changed

Security/FirewallMap.php

+1-8
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,7 @@ private function getFirewallContext(Request $request): ?FirewallContext
6666
if (null === $requestMatcher || $requestMatcher->matches($request)) {
6767
$request->attributes->set('_firewall_context', $contextId);
6868

69-
/** @var FirewallContext $context */
70-
$context = $this->container->get($contextId);
71-
72-
if ($context->getConfig()?->isStateless() && !$request->attributes->has('_stateless')) {
73-
$request->attributes->set('_stateless', true);
74-
}
75-
76-
return $context;
69+
return $this->container->get($contextId);
7770
}
7871
}
7972

Tests/Security/FirewallMapTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public function testGetListeners(Request $request, bool $expectedState)
6363
$firewallContext = $this->createMock(FirewallContext::class);
6464

6565
$firewallConfig = new FirewallConfig('main', 'user_checker', null, true, true);
66-
$firewallContext->expects($this->exactly(2))->method('getConfig')->willReturn($firewallConfig);
66+
$firewallContext->expects($this->once())->method('getConfig')->willReturn($firewallConfig);
6767

6868
$listener = function () {};
6969
$firewallContext->expects($this->once())->method('getListeners')->willReturn([$listener]);
@@ -93,7 +93,7 @@ public function testGetListeners(Request $request, bool $expectedState)
9393

9494
public static function providesStatefulStatelessRequests(): \Generator
9595
{
96-
yield [new Request(), true];
96+
yield [new Request(), false];
9797
yield [new Request(attributes: ['_stateless' => false]), false];
9898
yield [new Request(attributes: ['_stateless' => true]), true];
9999
}

0 commit comments

Comments
 (0)