Skip to content

Commit

Permalink
fixup! feat(app-framework): Add support for global middlewares
Browse files Browse the repository at this point in the history
Signed-off-by: Christoph Wurst <[email protected]>
  • Loading branch information
ChristophWurst committed Jan 25, 2023
1 parent ef329f7 commit 0563b8b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/private/AppFramework/DependencyInjection/DIContainer.php
Original file line number Diff line number Diff line change
Expand Up @@ -319,8 +319,9 @@ public function __construct(string $appName, array $urlParams = [], ServerContai
$coordinator = $c->get(\OC\AppFramework\Bootstrap\Coordinator::class);
$registrationContext = $coordinator->getRegistrationContext();
if ($registrationContext !== null) {
$appId = $this->getAppName();
foreach ($registrationContext->getMiddlewareRegistrations() as $middlewareRegistration) {
if ($middlewareRegistration->getAppId() === $this->getAppName()
if ($middlewareRegistration->getAppId() === $appId
|| $middlewareRegistration->isGlobal()) {
$dispatcher->registerMiddleware($c->get($middlewareRegistration->getService()));
}
Expand Down

0 comments on commit 0563b8b

Please sign in to comment.