Skip to content

Conversation

@paskal
Copy link
Collaborator

@paskal paskal commented Dec 16, 2025

Summary

Affected endpoints:

  • /auth/logout (when no providers defined) → 400 Bad Request
  • /auth/user (when not authenticated) → 401 Unauthorized
  • Auth endpoints with unsupported provider → 400 Bad Request

Replace WriteHeader + RenderJSON pattern with EncodeJSON to ensure
Content-Type: application/json header is set before WriteHeader is called.
This fixes go-pkgz/rest#38 where responses had text/plain content-type.
@paskal paskal requested a review from umputun as a code owner December 16, 2025 17:36
@coveralls
Copy link

coveralls commented Dec 16, 2025

Pull Request Test Coverage Report for Build 20277117952

Details

  • 12 of 12 (100.0%) changed or added relevant lines in 5 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.02%) to 83.652%

Totals Coverage Status
Change from base Build 19937627146: -0.02%
Covered Lines: 2671
Relevant Lines: 3193

💛 - Coveralls

@umputun umputun merged commit b18b2ea into master Dec 16, 2025
7 checks passed
@umputun umputun deleted the fix-content-type-header branch December 16, 2025 19:07
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