public function CspFirefoxBugTest::testStrictDynamic in Content-Security-Policy 8
Test that 'strict-dynamic' directive is copied from default-src.
@covers ::ff1313937
File
- tests/
src/ Unit/ CspFirefoxBugTest.php, line 40
Class
- CspFirefoxBugTest
- Test Csp handling of Firefox bug #1313937.
Namespace
Drupal\Tests\csp\UnitCode
public function testStrictDynamic() {
$policy = new Csp();
$policy
->setDirective('default-src', [
Csp::POLICY_STRICT_DYNAMIC,
"'nonce-abc'",
]);
$this
->assertEquals("default-src 'strict-dynamic' 'nonce-abc'; script-src 'strict-dynamic' 'nonce-abc'; style-src 'nonce-abc'", $policy
->getHeaderValue());
}