PHP Class Nelmio\SecurityBundle\EventListener\ContentSecurityPolicyListener

Inheritance: implements Symfony\Component\EventDispatcher\EventSubscriberInterface
Show file Open project: nelmio/NelmioSecurityBundle Class Usage Examples

Protected Properties

Property Type Description
$compatHeaders
$enforce
$hosts
$nonce
$nonceGenerator
$report
$sha
$shaComputer

Public Methods

Method Description
__construct ( DirectiveSet $report, DirectiveSet $enforce, NonceGenerator $nonceGenerator, ShaComputer $shaComputer, $compatHeaders = true, array $hosts = [], array $contentTypes = [] )
addScript ( $html )
addSha ( $directive, $sha )
addStyle ( $html )
getEnforcement ( )
getNonce ( )
getReport ( )
getSubscribedEvents ( )
onKernelRequest ( GetResponseEvent $event )
onKernelResponse ( FilterResponseEvent $e )

Private Methods

Method Description
buildHeaders ( Request $request, DirectiveSet $directiveSet, $reportOnly, $compatHeaders, array $signatures = null )

Method Details

__construct() public method

public __construct ( DirectiveSet $report, DirectiveSet $enforce, NonceGenerator $nonceGenerator, ShaComputer $shaComputer, $compatHeaders = true, array $hosts = [], array $contentTypes = [] )
$report Nelmio\SecurityBundle\ContentSecurityPolicy\DirectiveSet
$enforce Nelmio\SecurityBundle\ContentSecurityPolicy\DirectiveSet
$nonceGenerator Nelmio\SecurityBundle\ContentSecurityPolicy\NonceGenerator
$shaComputer Nelmio\SecurityBundle\ContentSecurityPolicy\ShaComputer
$hosts array
$contentTypes array

addScript() public method

public addScript ( $html )

addSha() public method

public addSha ( $directive, $sha )

addStyle() public method

public addStyle ( $html )

getEnforcement() public method

public getEnforcement ( )

getNonce() public method

public getNonce ( )

getReport() public method

public getReport ( )

getSubscribedEvents() public static method

public static getSubscribedEvents ( )

onKernelRequest() public method

public onKernelRequest ( GetResponseEvent $event )
$event Symfony\Component\HttpKernel\Event\GetResponseEvent

onKernelResponse() public method

public onKernelResponse ( FilterResponseEvent $e )
$e Symfony\Component\HttpKernel\Event\FilterResponseEvent

Property Details

$compatHeaders protected property

protected $compatHeaders

$enforce protected property

protected $enforce

$hosts protected property

protected $hosts

$nonce protected property

protected $nonce

$nonceGenerator protected property

protected $nonceGenerator

$report protected property

protected $report

$sha protected property

protected $sha

$shaComputer protected property

protected $shaComputer