You are here

private function CspSettingsForm::getConfigurableDirectives in Content-Security-Policy 8

Get the directives that should be configurable.

Return value

array An array of directive names.

3 calls to CspSettingsForm::getConfigurableDirectives()
CspSettingsForm::buildForm in src/Form/CspSettingsForm.php
Form constructor.
CspSettingsForm::submitForm in src/Form/CspSettingsForm.php
Form submission handler.
CspSettingsForm::validateForm in src/Form/CspSettingsForm.php
Form validation handler.

File

src/Form/CspSettingsForm.php, line 111

Class

CspSettingsForm
Form for editing Content Security Policy module settings.

Namespace

Drupal\csp\Form

Code

private function getConfigurableDirectives() {

  // Exclude some directives
  // - Reporting directives are handled by plugins.
  // - 'referrer' was deprecated prior to CSP Level 1 and not supported in
  //   most browsers.
  // - 'require-sri-for' was never publicly implemented, and dropped from the
  //   SRI spec.
  $directives = array_diff(Csp::getDirectiveNames(), [
    'report-uri',
    'report-to',
    'referrer',
    'require-sri-for',
  ]);
  return $directives;
}