Repository navigation
fix: show download progress for gzip compressed responses - #1358
Merged
Merged
Conversation
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.
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.
reqwest's
gzipfeature removes theContent-Lengthheader 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
gzipfeature, sendsAccept-Encoding: gzipon each request, and decompresses the downloaded content with flate2 when the response'sContent-Encodingisgzip. The progress bar now tracks the compressed bytes against the compressedContent-Length.The behaviour otherwise matches before:
gzipis decoded, so other encodings (includingx-gzip) are left as is.Content-EncodingandContent-Lengthare removed from the returned headers since they described the compressed content.