Skip to content

fix: show download progress for gzip compressed responses - #1358

Merged
dsherret merged 2 commits into
mainfrom
feat/manual-gzip-download
Oct 17, 2026
Merged

dsherret merged 2 commits into
mainfrom
feat/manual-gzip-download

Conversation

@dsherret

Copy link
Copy Markdown
Member

reqwest's gzip feature removes the Content-Length header when it decompresses a response, so a gzipped download showed a progress bar with no total (it stayed full while the size grew). This matters for serving compressed wasm plugins from plugins.dprint.dev.

This drops reqwest's gzip feature, sends Accept-Encoding: gzip on each request, and decompresses the downloaded content with flate2 when the response's Content-Encoding is gzip. The progress bar now tracks the compressed bytes against the compressed Content-Length.

The behaviour otherwise matches before:

  • Only gzip is decoded, so other encodings (including x-gzip) are left as is.
  • An empty body isn't decoded.
  • Content-Encoding and Content-Length are removed from the returned headers since they described the compressed content.

reqwest's gzip feature removes the content-length header when it
decompresses a response, so the progress bar had no total. dprint now
asks for gzip and decompresses the downloaded content itself.
@dsherret
dsherret merged commit 21953f9 into main Oct 17, 2026
23 checks passed
@dsherret
dsherret deleted the feat/manual-gzip-download branch October 17, 2026 17:33
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.

1 participant