ParagonIE\CSPBuilder\CSPBuilder::getHeaderKeys PHP Method

getHeaderKeys() protected method

Get an array of header keys to return
protected getHeaderKeys ( boolean $legacy = true ) : array
$legacy boolean
return array
    protected function getHeaderKeys(bool $legacy = true) : array
    {
        // We always want this
        $return = [$this->reportOnly ? 'Content-Security-Policy-Report-Only' : 'Content-Security-Policy'];
        // If we're supporting legacy devices, include these too:
        if ($legacy) {
            $return[] = $this->reportOnly ? 'X-Content-Security-Policy-Report-Only' : 'X-Content-Security-Policy';
            $return[] = $this->reportOnly ? 'X-Webkit-CSP-Report-Only' : 'X-Webkit-CSP';
        }
        return $return;
    }