Skip to content

Conversation

@paskal
Copy link
Collaborator

@paskal paskal commented Dec 16, 2025

Summary

  • Replace WriteHeader + RenderJSON pattern with EncodeJSON which sets Content-Type header before calling WriteHeader
  • Add tests to verify Content-Type is correctly set to application/json; charset=utf-8 for all affected middlewares

Fixes #38

…RenderJSON

Replace WriteHeader + RenderJSON pattern with EncodeJSON which sets
Content-Type header before calling WriteHeader. Fixes #38.
@paskal paskal requested a review from umputun as a code owner December 16, 2025 17:33
@coveralls
Copy link

Pull Request Test Coverage Report for Build 20277090136

Details

  • 7 of 7 (100.0%) changed or added relevant lines in 4 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.07%) to 87.976%

Totals Coverage Status
Change from base Build 19903558835: -0.07%
Covered Lines: 739
Relevant Lines: 840

💛 - Coveralls

@umputun umputun merged commit 6e22daa into master Dec 16, 2025
2 checks passed
@umputun umputun deleted the fix-content-type-header branch December 16, 2025 18:32
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.

Bug: WriteHeader before RenderJSON causes Content-Type header to be ignored

4 participants