diff options
Diffstat (limited to 'app/Core/Response.php')
-rw-r--r-- | app/Core/Response.php | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/app/Core/Response.php b/app/Core/Response.php index 347cdde7..d42a8f1e 100644 --- a/app/Core/Response.php +++ b/app/Core/Response.php @@ -168,6 +168,23 @@ class Response } /** + * Send a css response + * + * @access public + * @param string $data Raw data + * @param integer $status_code HTTP status code + */ + public function css($data, $status_code = 200) + { + $this->status($status_code); + + header('Content-Type: text/css; charset=utf-8'); + echo $data; + + exit; + } + + /** * Send a binary response * * @access public @@ -195,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).'; '; } @@ -246,7 +246,7 @@ class Response */ public function hsts() { - if (Tool::isHTTPS()) { + if (Request::isHTTPS()) { header('Strict-Transport-Security: max-age=31536000'); } } |