Skip to content

Commit

Permalink
🐛 fixed cps not working when panel did not have nources
Browse files Browse the repository at this point in the history
Signed-off-by: Bruno Meilick <b@bnomei.com>
  • Loading branch information
bnomei committed Sep 10, 2019
1 parent de4cd44 commit 3ca74ea
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion classes/SecurityHeaders.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,11 @@ public function __construct(array $options = [])
kirby()->urls()->panel
) !== false;
$panelHasNonces = method_exists(kirby()->system(), 'nonces');
$enabled = !kirby()->system()->isLocal() && ($isPanel && $panelHasNonces);

$enabled = !kirby()->system()->isLocal();
if ($isPanel && !$panelHasNonces) {
$enabled = false;
}

$defaults = [
'debug' => option('debug'),
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "bnomei/kirby3-security-headers",
"type": "kirby-plugin",
"version": "2.0.1",
"version": "2.0.2",
"license": "MIT",
"description": "Kirby 3 Plugin for easier Security Headers setup",
"authors": [
Expand Down

0 comments on commit 3ca74ea

Please sign in to comment.