Skip to content

Fix: Skip Content-Length for progress tracking when Content-Encoding …#1692

Draft
atulk-code wants to merge 1 commit intohttpie:masterfrom
atulk-code:fix/gzip-content-length-download
Draft

Fix: Skip Content-Length for progress tracking when Content-Encoding …#1692
atulk-code wants to merge 1 commit intohttpie:masterfrom
atulk-code:fix/gzip-content-length-download

Conversation

@atulk-code
Copy link

…is present

When Content-Encoding (e.g., gzip) is set, Content-Length represents the compressed size, but requests library automatically decompresses the response. This caused a mismatch where downloaded bytes exceeded Content-Length, leading to false 'Incomplete download' errors.

The fix skips using Content-Length for progress tracking when Content-Encoding header is present, since the decoded size will differ from the encoded size.

Added test case to verify this behavior.

Fixes #1642

…is present

When Content-Encoding (e.g., gzip) is set, Content-Length represents the
compressed size, but requests library automatically decompresses the response.
This caused a mismatch where downloaded bytes exceeded Content-Length, leading
to false 'Incomplete download' errors.

The fix skips using Content-Length for progress tracking when Content-Encoding
header is present, since the decoded size will differ from the encoded size.

Added test case to verify this behavior.

Fixes httpie#1642
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant