Content Security Policy 1.0 Header

link http://www.w3.org/TR/CSP/

 Methods

Create Content Security Policy header from a given header line

fromString(string $headerLine) : \Zend\Http\Header\self

Parameters

$headerLine

string

The header line to parse.

Exceptions

\Zend\Http\Header\Exception\InvalidArgumentException If the name field in the given header line does not match.

Returns

\Zend\Http\Header\self

Get the list of defined directives

getDirectives() : array

Returns

array

Get the header name

getFieldName() : string

Returns

string

Get the header value

getFieldValue() : string

Returns

string

Sets the directive to consist of the source list

setDirective(string $name, array $sources) : \Zend\Http\Header\self

Reverses http://www.w3.org/TR/CSP/#parsing-1

Parameters

$name

string

The directive name.

$sources

array

The source list.

Exceptions

\Zend\Http\Header\Exception\InvalidArgumentException If the name is not a valid directive name.

Returns

\Zend\Http\Header\self

Return the header as a string

toString() : string

Returns in form of "NAME: VALUE"

Returns

string

 Properties

 

The directives defined for this policy

$directives : array

 

Valid directive names

$validDirectiveNames : array