Skip to content
This repository has been archived by the owner on Sep 19, 2019. It is now read-only.

Commit

Permalink
Merge pull request #13 from harikt/path-issue
Browse files Browse the repository at this point in the history
Fix the path issue
  • Loading branch information
harikt committed Jan 22, 2015
2 parents 0bc3e44 + 09ac69c commit 9cfb311
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion config/routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
))
;

$router->add('admin', '/admin/')
$router->add('admin', '/admin')
->addValues(array(
'controller' => 'admin',
))
Expand Down
5 changes: 3 additions & 2 deletions src/Conduit/Middleware/RouterMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ public function __construct(Router $router, Dispatcher $dispatcher)

public function __invoke(ServerRequestInterface $request, ResponseInterface $response, callable $next = null)
{
$path = $request->getUri()->getPath();
$route = $this->router->match($path, $request->getServerParams());
$server = $request->getServerParams();
$path = parse_url($server['REQUEST_URI'], PHP_URL_PATH);
$route = $this->router->match($path, $server);
if (! $route) {
return $next();
}
Expand Down
2 changes: 1 addition & 1 deletion templates/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<li><a href="/">Home</a></li>
<li><a href="/blog">Blog</a></li>
<li><a href="/contact">Contact</a></li>
<li><a href="/admin/">Admin route</a></li>
<li><a href="/admin">Admin route</a></li>
<li><a href="/logout">Logout</a></li>
</ul>
</div><!-- /.nav-collapse -->
Expand Down

0 comments on commit 9cfb311

Please sign in to comment.