fix(conda): preserve gzip for large repodata indexes - #379
Merged
andrew merged 1 commit intoSep 26, 2026
Merged
Conversation
andrew
approved these changes
Sep 26, 2026
andrew
left a comment
Contributor
There was a problem hiding this comment.
Matches the fix specified in the issue and follows the proxyCachedWithEncoding pattern already used for the Homebrew API. Good catch on the cooldown path: handleRepodata was already sending Accept-Encoding: gzip and handing the compressed body to ReadMetadata, so filtering silently fell through to writing gzip bytes under Content-Type: application/json. The decode fixes that, and ReadMetadata's limit keeps the decompressed size bounded.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #321
Summary
Request gzip for Conda JSON repodata and preserve the compressed response through caching and delivery. This reduces transfer size and lets large indexes fit within the metadata cache limit when their compressed representation fits.
Changes
repodata.jsonandcurrent_repodata.json.Content-EncodingandContent-Length.repodata.json.bz2on identity encoding.Scope and limitations
metadata_max_size.Validation
Added regression coverage for both JSON routes, streaming, fresh-cache hits, offline fallback, identity responses,
.bz2preservation, size limits, cooldown filtering and invalid gzip.Confirmed the new regression tests reproduce the failures against the original handler.
Local checks passed:
git diff --checkgo tool golangci-lint run ./...— 0 issuesgo test -race ./...go test ./internal/handler -run 'TestConda' -count=10go vet ./...go build ./...go mod tidy -diff