Readability update

This commit is contained in:
shreypuranik 2020-07-15 17:19:14 +01:00 committed by Fabien Potencier
parent 0eafc01686
commit 6a7685f315
1 changed files with 8 additions and 1 deletions

View File

@ -127,8 +127,15 @@ class ContentSecurityPolicyHandler
$headers = $this->getCspHeaders($response);
$types = [
'script-src' => 'csp_script_nonce',
'script-src-elem' => 'csp_script_nonce',
'style-src' => 'csp_style_nonce',
'style-src-elem' => 'csp_style_nonce'
];
foreach ($headers as $header => $directives) {
foreach (['script-src' => 'csp_script_nonce', 'script-src-elem' => 'csp_script_nonce', 'style-src' => 'csp_style_nonce', 'style-src-elem' => 'csp_style_nonce'] as $type => $tokenName) {
foreach ($types as $type => $tokenName) {
if ($this->authorizesInline($directives, $type)) {
continue;
}