mirror of
https://github.com/flarum/framework.git
synced 2025-01-29 10:34:00 +08:00
prevent a couple of cycles by not resolving the excluded middleware on each middleware items
This commit is contained in:
parent
274dac123f
commit
7562878325
|
@ -119,8 +119,10 @@ class ApiServiceProvider extends AbstractServiceProvider
|
|||
$this->container->singleton(Client::class, function ($container) {
|
||||
$pipe = new MiddlewarePipe;
|
||||
|
||||
$middlewareStack = array_filter($container->make('flarum.api.middleware'), function ($middlewareClass) use ($container) {
|
||||
return ! in_array($middlewareClass, $container->make('flarum.api_client.exclude_middleware'));
|
||||
$exclude = $container->make('flarum.api_client.exclude_middleware');
|
||||
|
||||
$middlewareStack = array_filter($container->make('flarum.api.middleware'), function ($middlewareClass) use ($exclude) {
|
||||
return ! in_array($middlewareClass, $exclude);
|
||||
});
|
||||
|
||||
foreach ($middlewareStack as $middleware) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user