securityHeaders applies the baseline security headers the audit found missing (api-v1-redesign "HTTP header conventions"). It deliberately sets only the universally-safe `X-Content-Type-Options: nosniff` at this layer; HSTS is an edge (Caddy) concern and the stricter CSP/frame headers belong on the
(next http.Handler)
| 140 | // on the HTML confirmation pages, which set their own. Applying nosniff |
| 141 | // globally is additive and never breaks a JSON or HTML response. |
| 142 | func securityHeaders(next http.Handler) http.Handler { |
| 143 | return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { |
| 144 | w.Header().Set("X-Content-Type-Options", "nosniff") |
| 145 | next.ServeHTTP(w, r) |
| 146 | }) |
| 147 | } |