Skip to content

Commit

Permalink
Fix bug when removing base URL
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjamin Piwowarski authored Sep 26, 2019
1 parent 59fa1e2 commit d70edd4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Bridge/Symfony/Routing/Router.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,11 @@ public function getRouteCollection()
public function match($pathInfo)
{
$baseContext = $this->router->getContext();
$pathInfo = str_replace($baseContext->getBaseUrl(), '', $pathInfo);
$baseURL = $baseContext->getBaseUrl();
$p = strpos($pathInfo, $baseURL);
if (strpos($pathInfo, $baseURL) === 0) {
$pathInfo = substr($pathInfo, strlen($baseURL));
}

$request = Request::create($pathInfo, 'GET', [], [], [], ['HTTP_HOST' => $baseContext->getHost()]);
try {
Expand Down

0 comments on commit d70edd4

Please sign in to comment.