Skip to content

Commit

Permalink
⚡ disabled for panel and api automatically
Browse files Browse the repository at this point in the history
⬆️ updated dependencies

no need for config like discussed in #18 with @S1SYPHOS

Signed-off-by: Bruno Meilick <b@bnomei.com>
  • Loading branch information
bnomei committed Apr 22, 2021
1 parent 92f1401 commit 870ed75
Show file tree
Hide file tree
Showing 9 changed files with 1,609 additions and 951 deletions.
8 changes: 6 additions & 2 deletions classes/SecurityHeaders.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,16 @@ public function __construct(array $options = [])
{
$isPanel = strpos(
kirby()->request()->url()->toString(),
kirby()->urls()->panel
kirby()->urls()->panel()
) !== false;
$isApi = strpos(
kirby()->request()->url()->toString(),
kirby()->urls()->panel()
) !== false;
$panelHasNonces = method_exists(kirby(), 'nonce');

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

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.3.2",
"version": "2.4.0",
"license": "MIT",
"description": "Kirby 3 Plugin for easier Security Headers setup",
"authors": [
Expand Down
Loading

0 comments on commit 870ed75

Please sign in to comment.