Skip to content

Conversation

ali90h
Copy link

@ali90h ali90h commented Aug 11, 2025

Minimal fix + regression test.

When Content-Encoding is present, we no longer trust Content-Length for progress.
We track received bytes instead, which prevents false 'Incomplete download' and >100% overshoot.

ali90h and others added 3 commits August 11, 2025 12:27
Per RFC 9110 § 8.6 the Content-Length header reflects the **encoded**
size. The previous logic compared it to the decoded size, yielding
false "Incomplete download" errors for gzip responses.
@ali90h
Copy link
Author

ali90h commented Aug 11, 2025

Hi @isidentical could you please review when you have a moment?
This PR is very small: a focused fix in httpie/downloads.py plus a regression test for the gzip + Content-Length case.
CI failures look unrelated (3.7 runner / Big5 encoding heuristics). I’m happy to open a separate CI PR if needed. Thanks!

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