Readability update
This commit is contained in:
parent
0eafc01686
commit
6a7685f315
@ -127,8 +127,15 @@ class ContentSecurityPolicyHandler
|
|||||||
|
|
||||||
$headers = $this->getCspHeaders($response);
|
$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 ($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)) {
|
if ($this->authorizesInline($directives, $type)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user