Skip to content

Commit

Permalink
Use site_url for route-based RedirectResponse
Browse files Browse the repository at this point in the history
base_url does not actually add the base path if the given URL is
absolute (i.e., starts with a slash) and does not add the indexPage.
Both is necessary for the redirect response to work correctly in case
of routes. site_url handles this correctly.

Fixes codeigniter4#2119
  • Loading branch information
pkerling committed Sep 8, 2019
1 parent 3768431 commit 55e58bd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion system/HTTP/RedirectResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public function route(string $route, array $params = [], int $code = 302, string
throw HTTPException::forInvalidRedirectRoute($route);
}

return $this->redirect(base_url($route), $method, $code);
return $this->redirect(site_url($route), $method, $code);
}

/**
Expand Down

0 comments on commit 55e58bd

Please sign in to comment.