Skip to content

Commit

Permalink
Merge pull request #76 from fritzmg/patch-2
Browse files Browse the repository at this point in the history
un-deprecate `frame-src`
  • Loading branch information
paragonie-security authored Dec 18, 2023
2 parents 34b2d80 + 0d69592 commit 2a68e22
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/CSPBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -171,14 +171,22 @@ public function addSource(string $directive, string $path): self
$this->needsCompile = true;
switch ($directive) {
case 'child':
case 'child-src':
if ($this->supportOldBrowsers) {
$this->policies['child-src']['allow'][] = $path;
$this->policies['frame-src']['allow'][] = $path;
return $this;
}
$directive = 'child-src';
break;
case 'frame':
case 'frame-src':
if ($this->supportOldBrowsers) {
$this->policies['child-src']['allow'][] = $path;
$this->policies['frame-src']['allow'][] = $path;
return $this;
}
$directive = 'child-src';
$directive = 'frame-src';
break;
case 'connect':
case 'socket':
Expand Down

0 comments on commit 2a68e22

Please sign in to comment.