From: Roeland Jago Douma Date: Fri, 12 Aug 2016 13:15:24 +0000 (+0200) Subject: Move OCS Middleware before security middleware X-Git-Tag: v11.0RC2~821^2~7 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=deba0f992210ad2a3a837d8ad45d3b7fc63ecc79;p=nextcloud-server.git Move OCS Middleware before security middleware This is required to be able to catch the NotLoggedIn exceptions etc in the OCSMiddleware and convert them to proper OCS Responses. --- diff --git a/lib/private/AppFramework/DependencyInjection/DIContainer.php b/lib/private/AppFramework/DependencyInjection/DIContainer.php index 66ca59d26e2..b60ce643249 100644 --- a/lib/private/AppFramework/DependencyInjection/DIContainer.php +++ b/lib/private/AppFramework/DependencyInjection/DIContainer.php @@ -396,6 +396,7 @@ class DIContainer extends SimpleContainer implements IAppContainer { $this->registerService('MiddlewareDispatcher', function($c) use (&$middleWares) { $dispatcher = new MiddlewareDispatcher(); $dispatcher->registerMiddleware($c['CORSMiddleware']); + $dispatcher->registerMiddleware($c['OCSMiddleware']); $dispatcher->registerMiddleware($c['SecurityMiddleware']); $dispatcher->registerMiddleWare($c['TwoFactorMiddleware']); @@ -404,7 +405,6 @@ class DIContainer extends SimpleContainer implements IAppContainer { } $dispatcher->registerMiddleware($c['SessionMiddleware']); - $dispatcher->registerMiddleware($c['OCSMiddleware']); return $dispatcher; });