Skip to content

Commit

Permalink
satellite/console: add plausible to csp config
Browse files Browse the repository at this point in the history
This change fixes an issue where loading plausible script will not work
because it violates our CSP.

Change-Id: I1ed399705310ecbda47027f82038e89adad6da71
  • Loading branch information
wilfred-asomanii authored and Storj Robot committed Mar 29, 2024
1 parent 51f7ec7 commit b8ec98e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions satellite/console/consoleweb/server.go
Expand Up @@ -624,6 +624,11 @@ func (server *Server) setAppHeaders(w http.ResponseWriter, r *http.Request) {
scriptSrc = appendValues(scriptSrc, recap, gstatic)
frameSrc = appendValues(frameSrc, recap, recapSubdomain)
}
if server.AnalyticsConfig.Enabled && server.AnalyticsConfig.Plausible.Domain != "" {
plausible := "https://plausible.io"
connectSrc = appendValues(connectSrc, plausible)
scriptSrc = appendValues(scriptSrc, plausible)
}
cspValues := []string{
"default-src 'self'",
connectSrc,
Expand Down

0 comments on commit b8ec98e

Please sign in to comment.