Skip to content

Commit

Permalink
midllewaretrailingslash
Browse files Browse the repository at this point in the history
  • Loading branch information
schpill committed Nov 3, 2017
1 parent 28abf93 commit fd2dbd0
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 7 deletions.
4 changes: 1 addition & 3 deletions lib/fast.php
Original file line number Diff line number Diff line change
Expand Up @@ -599,9 +599,7 @@ public function addModule($moduleClass)

public function router()
{
if ($router = $this->define('router')) {
$this->define('router', $router);
} else {
if (!$this->define('router')) {
$this->define('router', new FastRouter);
}

Expand Down
2 changes: 1 addition & 1 deletion lib/fastmiddlewaretrailingslash.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public function process(ServerRequestInterface $request, DelegateInterface $next

$uri = $request->getUri()->getPath();

if (!empty($uri) && fnmatch('*/', $uri)) {
if (!empty($uri) && '/' !== $uri && fnmatch('*/', $uri)) {
return $app->redirectResponse(substr($uri, 0, -1));
}

Expand Down
3 changes: 0 additions & 3 deletions lib/lib.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
<?php
namespace Octo;

use function call_user_func_array;
use function func_get_args;
use Illuminate\Support\Debug\Dumper;
use function is_null;
use Psr\Http\Message\ServerRequestInterface;
use Zend\Expressive\Router\FastRouteRouter;

Expand Down

0 comments on commit fd2dbd0

Please sign in to comment.