Skip to content

Commit

Permalink
Support for Content Security Policy style-src-elem and script-src-ele…
Browse files Browse the repository at this point in the history
…m in WebProfiler

If a `style-src-elem` or `script-src-elem` Content Security Policy exist, the WebProfiler Styles or Scripts will be rejected as the nonce is missing.
  • Loading branch information
ampaze committed Apr 2, 2020
1 parent 5da141b commit 7f33f1f
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -128,7 +128,7 @@ private function updateCspHeaders(Response $response, array $nonces = [])
$headers = $this->getCspHeaders($response);

foreach ($headers as $header => $directives) {
foreach (['script-src' => 'csp_script_nonce', 'style-src' => 'csp_style_nonce'] as $type => $tokenName) {
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) {
if ($this->authorizesInline($directives, $type)) {
continue;
}
Expand Down

0 comments on commit 7f33f1f

Please sign in to comment.