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
1 files changed, 1 insertions(+), 0 deletions(-)
jump to
M internal/server/mux.go → internal/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'", )