Skip to content

Commit

Permalink
Fixed infinite locking for certain requests (#107)
Browse files Browse the repository at this point in the history
  • Loading branch information
indykoning authored Jan 8, 2025
1 parent 0995219 commit 0c3e3aa
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/RapidezStatamicServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Rapidez\Statamic;

use Illuminate\Foundation\Bootstrap\BootProviders;
use Illuminate\Routing\Router;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\Event;
Expand Down Expand Up @@ -49,6 +50,11 @@ public function register()
$router = app(Router::class);
$router->pushMiddlewareToGroup('web', StaticCache::class);
});
$this->app->afterBootstrapping(BootProviders::class, function () {
// Prevent infinite locks by removing the static cache from the statamic.web middleware.
$router = app(Router::class);
$router->removeMiddlewareFromGroup('statamic.web', StaticCache::class);
});
}

public function boot()
Expand Down

0 comments on commit 0c3e3aa

Please sign in to comment.