diff options
author | Alan Pearce | 2024-05-13 19:34:12 +0200 |
---|---|---|
committer | Alan Pearce | 2024-05-13 19:34:12 +0200 |
commit | 55efc5bec9703a299de5aac89006ed85600445fc (patch) | |
tree | 2e73e77ead7b6ad3820b3622be2b779b369e66ad /internal/server/headers.go | |
parent | 37deedc9b1da92571548c920721984d545269eb4 (diff) | |
download | searchix-55efc5bec9703a299de5aac89006ed85600445fc.tar.lz searchix-55efc5bec9703a299de5aac89006ed85600445fc.tar.zst searchix-55efc5bec9703a299de5aac89006ed85600445fc.zip |
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
Diffstat (limited to 'internal/server/headers.go')
-rw-r--r-- | internal/server/headers.go | 4 |
1 files changed, 2 insertions, 2 deletions
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) }) |