Skip to content

Conversation

ali90h
Copy link

@ali90h ali90h commented Aug 5, 2025

This pull request resolves issue #1642 by updating the download logic to ignore the Content-Length header when the response includes a Content-Encoding value other than identity.

When Content-Encoding is set (e.g., gzip), the Content-Length header refers to the compressed payload size—not the actual number of bytes written to disk after decompression. This mismatch previously caused:

Incorrect progress reporting

False "interrupted" download flags

The fix ensures that when a compressed response is detected, the downloader does not rely on Content-Length or Content-Range values, and instead trusts only the number of bytes successfully written. A corresponding test has been added to verify that gzip-compressed responses are handled correctly.

@ali90h ali90h changed the title Fix handling of Content-Encoding with downloads Fix: Ignore Content-Length for gzip responses in --download” Aug 6, 2025
@ali90h ali90h closed this Aug 6, 2025
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