Content Security Policy 1.0 Header

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

 Methods

Create Content Security Policy header from a given header line

fromString(string $headerLine) : \Zend\Http\Header\ContentSecurityPolicy
Static
inherited_from \Zend\Http\Header\HeaderInterface::fromString()
fluent This method is part of a fluent interface and will return the same instance

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\ContentSecurityPolicy

Get the list of defined directives

getDirectives() : array

Returns

array

Get the header name

getFieldName() : string
inherited_from \Zend\Http\Header\HeaderInterface::getFieldName()

Returns

string

Get the header value

getFieldValue() : string
inherited_from \Zend\Http\Header\HeaderInterface::getFieldValue()

Returns

string

Sets the directive to consist of the source list

setDirective(string $name, array $sources) : \Zend\Http\Header\ContentSecurityPolicy
fluent This method is part of a fluent interface and will return the same instance

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\ContentSecurityPolicy

Return the header as a string

toString() : string

Returns in form of "NAME: VALUE"

inherited_from \Zend\Http\Header\HeaderInterface::toString()

Returns

string

 Properties

 

The directives defined for this policy

$directives : array

Default

array()
 

Valid directive names

$validDirectiveNames : array

Default

array('default-src', 'script-src', 'object-src', 'style-src', 'img-src', 'media-src', 'frame-src', 'font-src', 'connect-src', 'sandbox', 'report-uri')