Use path info for routing

This commit is contained in:
Franz Liedke 2015-08-26 23:39:39 +02:00
parent d12106809f
commit 1e1f9e51ee

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);