diff --git a/src/CSPBuilder.php b/src/CSPBuilder.php index 6c0445d..f92954c 100644 --- a/src/CSPBuilder.php +++ b/src/CSPBuilder.php @@ -171,6 +171,14 @@ 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) { @@ -178,7 +186,7 @@ public function addSource(string $directive, string $path): self $this->policies['frame-src']['allow'][] = $path; return $this; } - $directive = 'child-src'; + $directive = 'frame-src'; break; case 'connect': case 'socket':