Skip to content

Commit

Permalink
FIX: do not ignore directives which have no values, such as 'upgrade-…
Browse files Browse the repository at this point in the history
…insecure-requests'
  • Loading branch information
JamesDPC committed Mar 28, 2024
1 parent 91be069 commit 4a79323
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Models/Directive.php
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ public function getDirectiveValue(bool $useFakeNonce = false) : string
*/
public function getDirectiveValueForPolicy(array $values) : string {
if(count($values) == 0) {
return "";
return $this->Key . ";";
} else {
$values = array_unique($values);
$directive = $this->Key . " " . implode(" ", $values) . ";";
Expand Down

0 comments on commit 4a79323

Please sign in to comment.