Skip to content

Commit

Permalink
Improve the routes
Browse files Browse the repository at this point in the history
  • Loading branch information
LuckyCyborg committed Jul 13, 2019
1 parent c33204a commit 536b9ce
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions app/Routes/Assets.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@
// Register the route for assets from Packages, Modules and Themes.
$dispatcher->route('packages/(:any)/(:any)/(:all)', function (Request $request, $vendor, $package, $path) use ($dispatcher)
{
$namespace = $vendor .'/' .$package;

if (is_null($packagePath = $dispatcher->getPackagePath($namespace))) {
if (is_null($packagePath = $dispatcher->getPackagePath($vendor, $package))) {
return Response::make('File Not Found', 404);
}

Expand All @@ -26,9 +24,7 @@
// Register the route for assets from Vendor.
$dispatcher->route('vendor/(:all)', function (Request $request, $path) use ($dispatcher)
{
$paths = $dispatcher->getVendorPaths();

if (! Str::startsWith($path, $paths)) {
if (! Str::startsWith($path, $dispatcher->getVendorPaths())) {
return Response::make('File Not Found', 404);
}

Expand Down

0 comments on commit 536b9ce

Please sign in to comment.