Use path info for routing

This commit is contained in:
Franz Liedke 2015-08-26 23:39:39 +02:00
parent e4ceb84aaf
commit 342f797d80

View File

@ -49,8 +49,9 @@ class RouterMiddleware
*/
public function __invoke(Request $request, Response $response, callable $out = null)
{
$serverParams = $request->getServerParams();
$uri = array_get($serverParams, 'PATH_INFO', $request->getUri()->getPath()) ?: '/';
$method = $request->getMethod();
$uri = $request->getUri()->getPath() ?: '/';
$routeInfo = $this->getDispatcher()->dispatch($method, $uri);