Skip to content

middleware: add security headers to all responses#80

Merged
0xFelix merged 1 commit intomainfrom
add-security-headers
Apr 18, 2026
Merged

middleware: add security headers to all responses#80
0xFelix merged 1 commit intomainfrom
add-security-headers

Conversation

@0xFelix
Copy link
Copy Markdown
Owner

@0xFelix 0xFelix commented Apr 18, 2026

Summary

  • Add a SecurityHeaders middleware that sets X-Content-Type-Options: nosniff, X-Frame-Options: DENY, Content-Security-Policy: default-src 'none', and Cache-Control: no-store on every response.
  • Wire it into the handler chain in pkg/app/app.go so every endpoint is covered.
  • Mirrors the headers already set in the PHP sibling project. HSTS is intentionally omitted - it belongs at the TLS-terminating reverse proxy, not in the app.

Test plan

  • make lint
  • make test
  • make functest

Signed-off-by: 0xFelix <felix@matouschek.org>
@0xFelix 0xFelix merged commit f5572df into main Apr 18, 2026
5 checks passed
@0xFelix 0xFelix deleted the add-security-headers branch April 18, 2026 16:54
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.

1 participant