about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--internal/builder/builder.go2
-rw-r--r--internal/server/server.go1
2 files changed, 3 insertions, 0 deletions
diff --git a/internal/builder/builder.go b/internal/builder/builder.go
index aec41e3..b17fbc2 100644
--- a/internal/builder/builder.go
+++ b/internal/builder/builder.go
@@ -7,6 +7,7 @@ import (
 	"os"
 	"path"
 	"slices"
+	"sync"
 	"time"
 
 	"website/internal/config"
@@ -62,6 +63,7 @@ func writerToFile(writer io.WriterTo, filename ...string) error {
 
 func build(outDir string, config config.Config) error {
 	log.Debug("output", "dir", outDir)
+	assetsOnce = sync.Once{}
 	privateDir := path.Join(outDir, "private")
 	if err := mkdirp(privateDir); err != nil {
 		return errors.WithMessage(err, "could not create private directory")
diff --git a/internal/server/server.go b/internal/server/server.go
index 71b9199..77905f8 100644
--- a/internal/server/server.go
+++ b/internal/server/server.go
@@ -39,6 +39,7 @@ type Server struct {
 }
 
 func applyDevModeOverrides(config *cfg.Config, listenAddress string) {
+	config.CSP.StyleSrc = slices.Insert(config.CSP.StyleSrc, 0, "'unsafe-inline'")
 	config.CSP.ScriptSrc = slices.Insert(config.CSP.ScriptSrc, 0, "'unsafe-inline'")
 	config.CSP.ConnectSrc = slices.Insert(config.CSP.ConnectSrc, 0, "'self'")
 	config.BaseURL = cfg.URL{