Skip to content

Add basic security headers to HTTP status server (#186)#202

Merged
ikaro1192 merged 1 commit into
mainfrom
worktree-fix-186
Apr 19, 2026
Merged

Add basic security headers to HTTP status server (#186)#202
ikaro1192 merged 1 commit into
mainfrom
worktree-fix-186

Conversation

@ikaro1192

Copy link
Copy Markdown
Owner

Summary

  • Wrap the WAI application with withSecurityHeaders middleware that sets X-Content-Type-Options: nosniff, X-Frame-Options: DENY, and Cache-Control: no-store on every response (including 404 / 405).
  • Expose securityHeaders, withSecurityHeaders, and securedHttpApp from PureMyHA.HTTP.Server; startHTTPServer now serves through securedHttpApp.
  • Add unit tests covering the constant and every route, plus an E2E header check on /health, /cluster/e2e/status, and /metrics.
  • Document the headers and their purpose in docs/http-api.md.

Closes #186.

Test plan

  • cabal build all (with -Werror)
  • cabal test — 617 examples, 0 failures
  • make e2e-test T=13 — 25 passed, 0 failed (includes 9 new header assertions)

🤖 Generated with Claude Code

Wrap the WAI application with middleware that sets
X-Content-Type-Options: nosniff, X-Frame-Options: DENY, and
Cache-Control: no-store on every response. Defence in depth against
accidental browser access to operator-facing endpoints; cluster state
snapshots also stay out of intermediate caches.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@codecov

codecov Bot commented Apr 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.17%. Comparing base (ce00446) to head (4b4756e).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #202      +/-   ##
==========================================
+ Coverage   97.14%   97.17%   +0.02%     
==========================================
  Files          50       50              
  Lines        8066     8148      +82     
==========================================
+ Hits         7836     7918      +82     
  Misses        230      230              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ikaro1192 ikaro1192 merged commit 39b3aed into main Apr 19, 2026
12 checks passed
@ikaro1192 ikaro1192 deleted the worktree-fix-186 branch April 19, 2026 08:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Security: HTTP status server lacks basic security response headers

1 participant