all repos — searchix @ b26ddba432f8bde78022d2fc8837f0ffb25448b1

Search engine for NixOS, nix-darwin, home-manager and NUR users

fix(dev): fix CSP not working in dev mode behind reverse proxy
Alan Pearce alan@alanpearce.eu
Wed, 15 Jan 2025 22:12:21 +0100
commit

b26ddba432f8bde78022d2fc8837f0ffb25448b1

parent

88b3b8158207e8f3ef6be4bc6d44cd450464eecc

1 files changed, 1 insertions(+), 0 deletions(-)

jump to
M internal/server/mux.gointernal/server/mux.go
@@ -40,6 +40,7 @@ cfg.Web.ContentSecurityPolicy.ScriptSrc = cfg.Web.ContentSecurityPolicy.DefaultSrc 	}
 	cfg.Web.ContentSecurityPolicy.ScriptSrc = append(
 		cfg.Web.ContentSecurityPolicy.ScriptSrc,
+		cfg.Web.BaseURL.JoinPath("_templ/reload/script.js").String(),
 		"http://localhost:7331",
 		"'unsafe-inline'",
 	)