From 5ac857bcdcd204d6dbfd86f8a09d241661cdd2c5 Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Fri, 24 May 2019 21:42:37 +0200 Subject: Add an event to edit the CSP This introduces and event that can be listend to when we actually use the CSP. This means that apps no longer have to always inject their CSP but only do so when it is required. Yay for being lazy. Signed-off-by: Roeland Jago Douma --- lib/private/Server.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'lib/private/Server.php') diff --git a/lib/private/Server.php b/lib/private/Server.php index 6a2d8106fb6..e10967debb4 100644 --- a/lib/private/Server.php +++ b/lib/private/Server.php @@ -1029,10 +1029,8 @@ class Server extends ServerContainer implements IServerContainer { $this->registerService(SessionStorage::class, function (Server $c) { return new SessionStorage($c->getSession()); }); - $this->registerService(\OCP\Security\IContentSecurityPolicyManager::class, function (Server $c) { - return new ContentSecurityPolicyManager(); - }); - $this->registerAlias('ContentSecurityPolicyManager', \OCP\Security\IContentSecurityPolicyManager::class); + $this->registerAlias(\OCP\Security\IContentSecurityPolicyManager::class, \OC\Security\CSP\ContentSecurityPolicyManager::class); + $this->registerAlias('ContentSecurityPolicyManager', \OC\Security\CSP\ContentSecurityPolicyManager::class); $this->registerService('ContentSecurityPolicyNonceManager', function (Server $c) { return new ContentSecurityPolicyNonceManager( -- cgit v1.2.3