diff options
Diffstat (limited to 'lib/private/appframework/dependencyinjection/dicontainer.php')
-rw-r--r-- | lib/private/appframework/dependencyinjection/dicontainer.php | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/private/appframework/dependencyinjection/dicontainer.php b/lib/private/appframework/dependencyinjection/dicontainer.php index 61a2333ecee..74b0a98f09f 100644 --- a/lib/private/appframework/dependencyinjection/dicontainer.php +++ b/lib/private/appframework/dependencyinjection/dicontainer.php @@ -108,18 +108,19 @@ class DIContainer extends SimpleContainer implements IAppContainer{ ); }); - $this['CORSMiddleware'] = $this->share(function($c) { + $this['CORSMiddleware'] = $this->share(function($c) use ($app){ return new CORSMiddleware( $c['Request'], - $c['ControllerMethodReflector'] + $c['ControllerMethodReflector'], + $app->getServer()->getUserSession() ); }); $middleWares = &$this->middleWares; $this['MiddlewareDispatcher'] = $this->share(function($c) use (&$middleWares) { $dispatcher = new MiddlewareDispatcher(); - $dispatcher->registerMiddleware($c['SecurityMiddleware']); $dispatcher->registerMiddleware($c['CORSMiddleware']); + $dispatcher->registerMiddleware($c['SecurityMiddleware']); foreach($middleWares as $middleWare) { $dispatcher->registerMiddleware($c[$middleWare]); |