refactor(config): simplify configuration commit 8225dbdb692c99b39dcafe2e5ec6ddc4daf08fb5 Author: Alan Pearce <alan@alanpearce.eu> Date: Mon May 13 19:18:26 2024 +0200 refactor: consolidate configuration to reduce command-line options commit 5616d4c5a9bc6c0c14f744f812fa6609f859dc34 Author: Alan Pearce <alan@alanpearce.eu> Date: Mon May 13 17:41:58 2024 +0200 refactor: move config file parsing to program entry points
1 file changed, 2 insertions(+), 2 deletions(-)
changed files
M internal/server/headers.go → internal/server/headers.go
@@ -7,10 +7,10 @@ ) func AddHeadersMiddleware(next http.Handler, config *cfg.Config) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - for h, v := range config.Headers { + for h, v := range config.Web.Headers { w.Header().Add(h, v) } - w.Header().Add("Content-Security-Policy", config.CSP.String()) + w.Header().Add("Content-Security-Policy", config.Web.ContentSecurityPolicy.String()) next.ServeHTTP(w, r) })