Support CSP in Matomo/Piwik plugin
Change-Id: Ie80c6ffca714460c310e2b55ad9b3b63f5ae71ad
diff --git a/lib/Kalamar.pm b/lib/Kalamar.pm
index 1dbc373..59d2695 100644
--- a/lib/Kalamar.pm
+++ b/lib/Kalamar.pm
@@ -164,16 +164,17 @@
});
# Establish content security policy
+ # This needs to be defined prior to Kalamar::Plugin::Piwik!
$self->plugin(CSP => {
'default-src' => 'self',
- 'style-src' => ['self','unsafe-inline'],
- 'script-src' => 'self',
+ 'style-src' => ['self','unsafe-inline'],
+ 'script-src' => 'self',
'connect-src' => 'self',
- 'frame-src' => '*',
- 'media-src' => 'none',
- 'object-src' => 'self',
- 'font-src' => 'self',
- 'img-src' => ['self', 'data:'],
+ 'frame-src' => '*',
+ 'media-src' => 'none',
+ 'object-src' => 'self',
+ 'font-src' => 'self',
+ 'img-src' => ['self', 'data:'],
-with_nonce => 1
});
@@ -251,15 +252,6 @@
};
# Deprecated Legacy code
- if ($self->config('Piwik') &&
- none { $_ eq 'Piwik' } @{$conf->{plugins} // []}) {
-
- # 2018-11-12
- deprecated 'Piwik is no longer considered a mandatory plugin';
- $self->plugin('Kalamar::Plugin::Piwik');
- };
-
- # Deprecated Legacy code
if ($self->config('Kalamar')->{auth_support} &&
none { $_ eq 'Auth' } @{$conf->{plugins} // []}) {