getHeaderArray() public method

Get an associative array of headers to return.
public getHeaderArray ( boolean $legacy = true ) : array
$legacy boolean
return array
 /**
  * Get csp header.
  *
  * @return array
  */
 protected function csp()
 {
     if (!is_null($this->config['custom-csp'])) {
         return ['Content-Security-Policy' => $this->config['custom-csp']];
     }
     $csp = new CSPBuilder($this->config['csp']);
     return $csp->getHeaderArray(false);
 }