Skip to content

Commit

Permalink
Add plausible event api to connect sources
Browse files Browse the repository at this point in the history
  • Loading branch information
thechubbypanda committed Jun 20, 2024
1 parent d7edc72 commit 1b7d8b8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,13 @@ func main() {

cspParts := []string{"default-src 'self'", "style-src 'self' 'unsafe-inline'"}
scriptSources := []string{"unpkg.com"}
var connectSources []string
if cfg.Plausible.ScriptUrl != "" {
scriptSources = append(scriptSources, cfg.Plausible.Origin)
connectSources = append(connectSources, cfg.Plausible.Origin)
}
cspParts = append(cspParts, "script-src "+strings.Join(scriptSources, " "))
cspParts = append(cspParts, "connect-src "+strings.Join(connectSources, " "))

r.Use(
logger.Logger("router", logrus.StandardLogger()),
Expand Down

0 comments on commit 1b7d8b8

Please sign in to comment.