aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/AppFramework/DependencyInjection
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2017-09-22 12:21:44 +0200
committerRoeland Jago Douma <roeland@famdouma.nl>2017-09-24 21:07:16 +0200
commitc257cd57d46143b6007f3c2cb80576c7320dc19e (patch)
tree524f24b43f5dd8edd12942a99bd8ec9e74f4ef00 /lib/private/AppFramework/DependencyInjection
parent4ee731c1ab20b3fb62c9e46abcc3ed717b891e59 (diff)
downloadnextcloud-server-c257cd57d46143b6007f3c2cb80576c7320dc19e.tar.gz
nextcloud-server-c257cd57d46143b6007f3c2cb80576c7320dc19e.zip
Handle SameSiteCookie check for index.php in AppFramework Middleware
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'lib/private/AppFramework/DependencyInjection')
-rw-r--r--lib/private/AppFramework/DependencyInjection/DIContainer.php8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/private/AppFramework/DependencyInjection/DIContainer.php b/lib/private/AppFramework/DependencyInjection/DIContainer.php
index e33ffdca96c..2290f0d0045 100644
--- a/lib/private/AppFramework/DependencyInjection/DIContainer.php
+++ b/lib/private/AppFramework/DependencyInjection/DIContainer.php
@@ -291,9 +291,17 @@ class DIContainer extends SimpleContainer implements IAppContainer {
);
});
+ $this->registerService(OC\AppFramework\Middleware\Security\SameSiteCookieMiddleware::class, function (SimpleContainer $c) {
+ return new OC\AppFramework\Middleware\Security\SameSiteCookieMiddleware(
+ $c['Request'],
+ $c['ControllerMethodReflector']
+ );
+ });
+
$middleWares = &$this->middleWares;
$this->registerService('MiddlewareDispatcher', function($c) use (&$middleWares) {
$dispatcher = new MiddlewareDispatcher();
+ $dispatcher->registerMiddleware($c[OC\AppFramework\Middleware\Security\SameSiteCookieMiddleware::class]);
$dispatcher->registerMiddleware($c['CORSMiddleware']);
$dispatcher->registerMiddleware($c['OCSMiddleware']);
$dispatcher->registerMiddleware($c['SecurityMiddleware']);