]> source.dussan.org Git - nextcloud-server.git/commitdiff
Move OCS Middleware before security middleware
authorRoeland Jago Douma <roeland@famdouma.nl>
Fri, 12 Aug 2016 13:15:24 +0000 (15:15 +0200)
committerRoeland Jago Douma <roeland@famdouma.nl>
Sun, 14 Aug 2016 16:34:01 +0000 (18:34 +0200)
This is required to be able to catch the NotLoggedIn exceptions etc in
the OCSMiddleware and convert them to proper OCS Responses.

lib/private/AppFramework/DependencyInjection/DIContainer.php

index 66ca59d26e2daef7ceb1699dc7e2551652536002..b60ce6432499c8c71145178d0e927dc26f7a3531 100644 (file)
@@ -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;
                });