From 55efc5bec9703a299de5aac89006ed85600445fc Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Mon, 13 May 2024 19:34:12 +0200 Subject: refactor(config): simplify configuration commit 8225dbdb692c99b39dcafe2e5ec6ddc4daf08fb5 Author: Alan Pearce Date: Mon May 13 19:18:26 2024 +0200 refactor: consolidate configuration to reduce command-line options commit 5616d4c5a9bc6c0c14f744f812fa6609f859dc34 Author: Alan Pearce Date: Mon May 13 17:41:58 2024 +0200 refactor: move config file parsing to program entry points --- internal/server/headers.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'internal/server/headers.go') diff --git a/internal/server/headers.go b/internal/server/headers.go index 0efc384..4fb9efd 100644 --- a/internal/server/headers.go +++ b/internal/server/headers.go @@ -7,10 +7,10 @@ import ( 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) }) -- cgit 1.4.1