You are here

public function Csp::hasDirective in Content-Security-Policy 8

Check if the policy currently has the specified directive.

Parameters

string $name: The directive name.

Return value

bool If the policy has the specified directive.

1 call to Csp::hasDirective()
Csp::fallbackAwareAppendIfEnabled in src/Csp.php
Append to a directive if it or a fallback directive is enabled.

File

src/Csp.php, line 245

Class

Csp
A CSP Header.

Namespace

Drupal\csp

Code

public function hasDirective($name) {
  return isset($this->directives[$name]);
}