summaryrefslogtreecommitdiff
path: root/src/Middleware/RouteDispatcher.php
diff options
context:
space:
mode:
authorIgor Scheller <igor.scheller@igorshp.de>2018-12-28 03:28:33 +0100
committermsquare <msquare@notrademark.de>2018-12-28 20:35:44 +0100
commit491ee376517cded3c9c8d2389e3f9f21daa1a407 (patch)
tree7def296bc1e53691bb7d5b79c542e002c009ed24 /src/Middleware/RouteDispatcher.php
parent7b3901211a0165558eebca8fe7490ca79b09f97b (diff)
Don't save sessions permanently on api and metrics paths
closes #530 (Session on API calls)
Diffstat (limited to 'src/Middleware/RouteDispatcher.php')
-rw-r--r--src/Middleware/RouteDispatcher.php4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/Middleware/RouteDispatcher.php b/src/Middleware/RouteDispatcher.php
index 24a7906d..c20eba4b 100644
--- a/src/Middleware/RouteDispatcher.php
+++ b/src/Middleware/RouteDispatcher.php
@@ -50,7 +50,8 @@ class RouteDispatcher implements MiddlewareInterface
$path = $request->getPathInfo();
}
- $route = $this->dispatcher->dispatch($request->getMethod(), urldecode($path));
+ $path = urldecode($path);
+ $route = $this->dispatcher->dispatch($request->getMethod(), $path);
$status = $route[0];
if ($status == FastRouteDispatcher::NOT_FOUND) {
@@ -70,6 +71,7 @@ class RouteDispatcher implements MiddlewareInterface
$routeHandler = $route[1];
$request = $request->withAttribute('route-request-handler', $routeHandler);
+ $request = $request->withAttribute('route-request-path', $path);
$vars = $route[2];
foreach ($vars as $name => $value) {