feat: authorize Plausible script

This commit is contained in:
2025-07-24 08:36:46 +04:00
parent a08576cea4
commit 0a3604daad
2 changed files with 15 additions and 15 deletions
+2 -2
View File
@@ -218,7 +218,7 @@ function setSecurityHeaders() {
$csp = "default-src 'self'; "; $csp = "default-src 'self'; ";
$csp .= "style-src 'self' 'unsafe-inline' https://cdnjs.cloudflare.com; "; $csp .= "style-src 'self' 'unsafe-inline' https://cdnjs.cloudflare.com; ";
$csp .= "script-src 'self' 'unsafe-inline' https://cdnjs.cloudflare.com; "; $csp .= "script-src 'self' 'unsafe-inline' https://cdnjs.cloudflare.com https://plausible.io; "; // PLAUSIBLE UPDATED
// Images : autoriser les domaines externes plus HTTPS général en dev // Images : autoriser les domaines externes plus HTTPS général en dev
$imgSrc = "'self' data: " . ($mastodonDomain ? $mastodonDomain : '') . " " . ($peertubeDomain ? $peertubeDomain : ''); $imgSrc = "'self' data: " . ($mastodonDomain ? $mastodonDomain : '') . " " . ($peertubeDomain ? $peertubeDomain : '');
@@ -241,7 +241,7 @@ function setSecurityHeaders() {
$csp .= "frame-src " . $frameSrc . "; "; $csp .= "frame-src " . $frameSrc . "; ";
// Connexions : autoriser Mastodon et PeerTube // Connexions : autoriser Mastodon et PeerTube
$connectSrc = "'self' " . ($mastodonDomain ? $mastodonDomain : '') . " " . ($peertubeDomain ? $peertubeDomain : ''); $connectSrc = "'self' https://plausible.io " . ($mastodonDomain ? $mastodonDomain : '') . " " . ($peertubeDomain ? $peertubeDomain : '');
if ($isLocalDev) { if ($isLocalDev) {
$connectSrc .= " ws: wss:"; // WebSockets pour le dev $connectSrc .= " ws: wss:"; // WebSockets pour le dev
} }