src/CSPBuilder.php
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;
    }
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;
    }
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 ; }
Get an array of header keys to return

@param bool $legacy
@return array
Get an array of header keys to return