Skip to content

Commit

Permalink
bugfixes
Browse files Browse the repository at this point in the history
  • Loading branch information
gossi committed Jul 21, 2016
1 parent f342dc6 commit 5621bf5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
3 changes: 0 additions & 3 deletions src/kernel/AbstractKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@
use keeko\framework\service\ServiceContainer;
use phootwork\collection\Map;
use Symfony\Component\EventDispatcher\EventDispatcher;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\Cookie;
use keeko\core\model\ApplicationUriQuery;

abstract class AbstractKernel {

Expand Down
5 changes: 3 additions & 2 deletions src/routing/ApplicationRouter.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,14 @@ public function match($request) {
->filterByHttphost($request->getHttpHost())
->find();

$requestUri = new Text($request->getRequestUri());
$requestUri = Text::create($request->getRequestUri())->trimRight('/');
foreach ($uris as $uri) {
$basepath = new Text($uri->getBasepath());

// either request uri and uri basepath are both empty
// or request uri starts with basepath
if (($basepath->isEmpty() && $requestUri->isEmpty()) || $requestUri->startsWith($basepath)) {
if (($basepath->isEmpty() && $uri->getHttphost() == $request->getHttpHost())
|| $requestUri->startsWith($basepath)) {
// assign when it's the first found
if ($found === null) {
$found = $uri;
Expand Down

0 comments on commit 5621bf5

Please sign in to comment.