Skip to content

Comments

fix(client): handle gzipped errors#280

Merged
hannahhoward merged 2 commits intomainfrom
fix/gunzip_500_responses
Dec 10, 2025
Merged

fix(client): handle gzipped errors#280
hannahhoward merged 2 commits intomainfrom
fix/gunzip_500_responses

Conversation

@hannahhoward
Copy link
Member

when content encoding is gzipped even for 500s, unzip the response. also adds tests for gzipped encoding

when content encoding is gzipped even for 500s, unzip the response. also adds tests.
@codecov
Copy link

codecov bot commented Nov 30, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.

Files with missing lines Coverage Δ
pkg/client/client.go 48.69% <100.00%> (+9.35%) ⬆️

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Member

@volmedo volmedo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works, but handling gzip manually in the client is not needed.

I wrote this PR that target yours: #281. There, I removed the gzip-related code to use the built-in support and the tests still pass. PTAL and let me know what you think.

Go's HTTP client in the standard library supports gzip automatically
when one doesn't set the `Accept-Encoding: gzip` header. If the header
is not set, the client will do it automatically (unless it's disabled in
the underlying transport) and will also handle compression/decompression
internally.

I removed the code setting the `Accept-Encoding` header and also manual
comp/decomp and the implementation still passes the tests.
@hannahhoward hannahhoward merged commit 15cea69 into main Dec 10, 2025
10 of 11 checks passed
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.

3 participants