Skip to content

Code cleanup and middleware order correction - #779

Merged
poppastring merged 4 commits into
mainfrom
code-cleanup/round1
Feb 17, 2026
Merged

poppastring merged 4 commits into
mainfrom
code-cleanup/round1

Conversation

@poppastring

Copy link
Copy Markdown
Owner

PR Classification

Code cleanup and middleware order correction to improve maintainability and security.

PR Summary

This pull request refactors directory creation logic, updates middleware usage for security, and improves code structure and efficiency.

  • SiteRepairer.cs: Refactored RepairSite() to loop over required folders, reducing duplication and improving error reporting.
  • DasBlogApplicationBuilderExtensions.cs: Removed deprecated XXssProtection middleware, fixed code structure, and made extension methods properly accessible.
  • Program.cs: Moved UseDasBlogThreadPrincipal middleware registration before routing for correct execution order.
  • DasBlogHealthChecks.cs: Optimized health check by reusing the SystemCheck() result.

Refactored DasBlogApplicationBuilderExtensions.cs for proper indentation and structure, improving readability without changing logic. Fixed a bug in DasBlogHealthChecks.cs by storing the SystemCheck() result in a variable to avoid redundant calls and ensure consistent health check results.
The UseXXssProtection middleware call was removed from UseDasBlogSecurityHeaders in DasBlogApplicationBuilderExtensions.cs.
This stops adding the X-XSS-Protection HTTP header, as modern browsers no longer support or require it for XSS protection.
@poppastring
poppastring merged commit 5a0e01d into main Feb 17, 2026
3 checks passed
@poppastring
poppastring deleted the code-cleanup/round1 branch February 17, 2026 00:11
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