aboutsummaryrefslogtreecommitdiff
path: root/app/FreshRSS.php
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2016-02-21 21:25:23 +0100
committerGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2016-02-21 21:25:23 +0100
commit38c2d671e3480b8e9fb38491797e44fdea317006 (patch)
tree3b753dc6ae896918932199502493337966ad2006 /app/FreshRSS.php
parentcb913a3a76daf357ad36ca39c26b4aaf800211d2 (diff)
CSP different policies per controller
https://github.com/FreshRSS/FreshRSS/issues/1075
Diffstat (limited to 'app/FreshRSS.php')
-rw-r--r--app/FreshRSS.php14
1 files changed, 10 insertions, 4 deletions
diff --git a/app/FreshRSS.php b/app/FreshRSS.php
index 62ea18d96..bfbd7a6eb 100644
--- a/app/FreshRSS.php
+++ b/app/FreshRSS.php
@@ -111,10 +111,16 @@ class FreshRSS extends Minz_FrontController {
}
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;
}
}