diff --git a/app/FreshRSS.php b/app/FreshRSS.php index 62ea18d96c0..bfbd7a6eb96 100644 --- a/app/FreshRSS.php +++ b/app/FreshRSS.php @@ -111,10 +111,16 @@ private function loadStylesAndScripts() { } public static function preLayout() { - if (Minz_Request::controllerName() === 'stats') { - header("Content-Security-Policy: default-src 'self'; style-src 'self' 'unsafe-inline'"); - } else { - header("Content-Security-Policy: default-src 'self'; child-src *; img-src * data:; media-src *"); + switch (Minz_Request::controllerName()) { + case 'index': + header("Content-Security-Policy: default-src 'self'; child-src *; img-src * data:; media-src *"); + break; + case 'stats': + header("Content-Security-Policy: default-src 'self'; style-src 'self' 'unsafe-inline'"); + break; + default: + header("Content-Security-Policy: default-src 'self'"); + break; } } diff --git a/app/install.php b/app/install.php index 03f6e2199c9..a4a888af2c1 100644 --- a/app/install.php +++ b/app/install.php @@ -2,6 +2,7 @@ if (function_exists('opcache_reset')) { opcache_reset(); } +header("Content-Security-Policy: default-src 'self'"); define('BCRYPT_COST', 9);