Skip to content

Commit f3e0f0e

Browse files
committed
[HttpKernel] fixed internal fragment handling
1 parent fa8f4f8 commit f3e0f0e

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

EventListener/FragmentListener.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
use Symfony\Component\HttpKernel\KernelEvents;
1717
use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;
1818
use Symfony\Component\HttpKernel\UriSigner;
19+
use Symfony\Component\HttpKernel\HttpKernelInterface;
1920
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
2021

2122
/**
@@ -24,8 +25,8 @@
2425
* All URL paths starting with /_fragment are handled as
2526
* content fragments by this listener.
2627
*
27-
* If the request does not come from a trusted IP, it throws an
28-
* AccessDeniedHttpException exception.
28+
* If throws an AccessDeniedHttpException exception if the request
29+
* is not signed or if it is not an internal sub-request.
2930
*
3031
* @author Fabien Potencier <[email protected]>
3132
*/
@@ -61,7 +62,9 @@ public function onKernelRequest(GetResponseEvent $event)
6162
return;
6263
}
6364

64-
$this->validateRequest($request);
65+
if (HttpKernelInterface::MASTER_REQUEST === $event->getRequestType()) {
66+
$this->validateRequest($request);
67+
}
6568

6669
parse_str($request->query->get('_path', ''), $attributes);
6770
$request->attributes->add($attributes);

0 commit comments

Comments
 (0)