Permalink
Browse files

Change pathMatchesPattern to requestMatchesPattern

  • Loading branch information...
1 parent 8ac0cc6 commit 6069b6af71ca7df2793088c2bbd0658caec53cc6 @igorw igorw committed Nov 4, 2012
Showing with 3 additions and 3 deletions.
  1. +3 −3 src/React/Gifsocket/Router.php
@@ -14,7 +14,7 @@ public function __construct(array $routes)
public function __invoke($request, $response)
{
foreach ($this->routes as $pattern => $controller) {
- if ($this->pathMatchesPattern($request->getPath(), $pattern, $controller)) {
+ if ($this->requestMatchesPattern($request, $pattern)) {
$controller($request, $response);
return;
}
@@ -23,9 +23,9 @@ public function __invoke($request, $response)
$this->handleNotFound($request, $response);
}
- protected function pathMatchesPattern($requestPath, $pattern, $controller)
+ protected function requestMatchesPattern($request, $pattern)
{
- return $pattern === $requestPath;
+ return $pattern === $request->getPath();
}
protected function handleNotFound($request, $response)

0 comments on commit 6069b6a

Please sign in to comment.