Skip to content

httptransport: fix negotiated error responses#2454

Merged
github-actions[bot] merged 1 commit into
quay:mainfrom
immanuwell:fix/content-negotiation-error-response
May 11, 2026
Merged

httptransport: fix negotiated error responses#2454
github-actions[bot] merged 1 commit into
quay:mainfrom
immanuwell:fix/content-negotiation-error-response

Conversation

@immanuwell
Copy link
Copy Markdown
Contributor

@immanuwell immanuwell commented May 9, 2026

Small cleanup for content negotiation error path.

Before this, pickContentType wrote 415 itself, then callers tried to send apiError. Too late: headers were already committed, so /openapi/v1 with Accept: application/xml got a 415 with no JSON content-type. tiny paper cut, but annoying for clients.

Repro:

  • before: go test ./httptransport -run 'TestDiscovery/Failure' -count=1 -v fails with got content-type: "", want: "application/json"
  • after: same test passes

Validation:

  • go test ./httptransport -run 'TestDiscovery' -count=1
  • go test ./...

Related: #1441, #1523-ish

@immanuwell immanuwell requested a review from a team as a code owner May 9, 2026 09:27
@immanuwell immanuwell requested review from crozzy and removed request for a team May 9, 2026 09:27
Signed-off-by: immanuwell <pchpr.00@list.ru>
@crozzy crozzy force-pushed the fix/content-negotiation-error-response branch from 0144318 to f77fca4 Compare May 11, 2026 16:52
@crozzy
Copy link
Copy Markdown
Collaborator

crozzy commented May 11, 2026

/fast-forward

@github-actions github-actions Bot merged commit f77fca4 into quay:main May 11, 2026
8 checks passed
@crozzy
Copy link
Copy Markdown
Collaborator

crozzy commented May 11, 2026

Thanks @immanuwell for the contribution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants