public sendCSPHeader ( boolean $legacy = true ) : boolean | ||
$legacy | boolean | Send legacy headers? |
return | boolean |
public function sendCSPHeader(bool $legacy = true) : bool
{
if (\headers_sent()) {
throw new \Exception('Headers already sent!');
}
if ($this->needsCompile) {
$this->compile();
}
foreach ($this->getHeaderKeys($legacy) as $key) {
\header($key . ': ' . $this->compiled);
}
return true;
}