From 3e2f4f9c2cd4cd67bee428a23ce55fc36b8c6e31 Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sun, 1 Feb 2015 14:38:29 -0500 Subject: Simplify CSP header method --- app/Core/Response.php | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) (limited to 'app') diff --git a/app/Core/Response.php b/app/Core/Response.php index 1ce42ad3..d42a8f1e 100644 --- a/app/Core/Response.php +++ b/app/Core/Response.php @@ -212,24 +212,7 @@ class Response $policies['default-src'] = "'self'"; $values = ''; - foreach ($policies as $policy => $hosts) { - - if (is_array($hosts)) { - - $acl = ''; - - foreach ($hosts as &$host) { - - if ($host === '*' || $host === 'self' || strpos($host, 'http') === 0) { - $acl .= $host.' '; - } - } - } - else { - - $acl = $hosts; - } - + foreach ($policies as $policy => $acl) { $values .= $policy.' '.trim($acl).'; '; } -- cgit v1.2.3