You are here

public function Uri::alterPolicy in Content-Security-Policy 8

Alter the provided policy according to the plugin settings.

Parameters

\Drupal\csp\Csp $policy: The policy to alter.

Overrides ReportingHandlerBase::alterPolicy

File

src/Plugin/CspReportingHandler/Uri.php, line 60

Class

Uri
CSP Reporting Plugin for a URI endpoint.

Namespace

Drupal\csp\Plugin\CspReportingHandler

Code

public function alterPolicy(Csp $policy) {
  $policy
    ->setDirective('report-uri', $this->configuration['uri']);
}