Skip to content

Commit 0b60a4c

Browse files
committedFeb 10, 2025
bug #6806 Change AdminRouterSubscriber::getSymfonyControllerFqcn so it generates relative paths (pacproduct)
This PR was merged into the 4.x branch. Discussion ---------- Change AdminRouterSubscriber::getSymfonyControllerFqcn so it generates relative paths Change the behavior of "\EasyCorp\Bundle\EasyAdminBundle\EventListener\AdminRouterSubscriber::getSymfonyControllerFqcn" to generate relative path instead of absolute path, so it is compatible with applications running behind a proxy under a permanent subpath prefix (AKA sub-folder, sub-url or sub-path - using the HTTP header `x-forwarded-prefix`). Linked issue: #6805 Commits ------- e1ead89 Change AdminRouterSubscriber::getSymfonyControllerFqcn so it generates relative paths. Change the behavior of "\EasyCorp\Bundle\EasyAdminBundle\EventListener\AdminRouterSubscriber::getSymfonyControllerFqcn" to generate relative path instead of absolute, so it is compatible with applications running behind a proxy with a path prefix (AKA sub-folder, sub-url or sub-path - using the HTTP header "x-forwarded-prefix").
2 parents 448072e + e1ead89 commit 0b60a4c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎src/EventListener/AdminRouterSubscriber.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ private function getSymfonyControllerFqcn(Request $request): ?string
289289
{
290290
$routeName = $request->query->get(EA::ROUTE_NAME);
291291
$routeParams = $request->query->all()[EA::ROUTE_PARAMS] ?? [];
292-
$url = $this->urlGenerator->generate($routeName, $routeParams);
292+
$url = $this->urlGenerator->generate($routeName, $routeParams, UrlGeneratorInterface::RELATIVE_PATH);
293293

294294
$newRequest = $request->duplicate();
295295
$newRequest->attributes->remove('_controller');

0 commit comments

Comments
 (0)
Please sign in to comment.