echo
echo copied to clipboard
Improve secure middleware readability and add deprecation notice
Summary
Improves code readability and maintainability of the secure middleware with better user guidance.
Changes:
- Refactor HSTS header construction - Replace nested
fmt.Sprintfwith slice building andstrings.Joinfor clearer logic - Add X-XSS-Protection deprecation notice - Document that CSP is recommended over the deprecated header
- Clean up imports - Remove unused
fmtimport
Benefits:
- Cleaner, more maintainable HSTS directive building
- Better user guidance about modern security practices
- Improved code readability
Test plan
- [x] All existing tests pass
- [x] Linting passes
- [x] No behavioral changes to security headers
Fixes #2799
🤖 Generated with Claude Code