diff options
Diffstat (limited to 'lib/template.php')
-rw-r--r-- | lib/template.php | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/template.php b/lib/template.php index f7124ebc09c..238d8a8ad0f 100644 --- a/lib/template.php +++ b/lib/template.php @@ -186,9 +186,15 @@ class OC_Template{ $this->l10n = OC_L10N::get($parts[0]); // Some headers to enhance security - header('X-Frame-Options: Sameorigin'); - header('X-XSS-Protection: 1; mode=block'); - header('X-Content-Type-Options: nosniff'); + header('X-Frame-Options: Sameorigin'); // Disallow iFraming from other domains + header('X-XSS-Protection: 1; mode=block'); // Enforce browser based XSS filters + header('X-Content-Type-Options: nosniff'); // Disable sniffing the content type for IE + + // Content Security Policy + // If you change the standard policy, please also change it in config.sample.php + $policy = OC_Config::getValue('custom_csp_policy', 'default-src \'self\'; script-src \'self\' \'unsafe-eval\'; style-src \'self\' \'unsafe-inline\'; frame-src *; img-src *'); + header('Content-Security-Policy:'.$policy); // Standard + header('X-WebKit-CSP:'.$policy); // Older webkit browsers $this->findTemplate($name); } |