Skip to content

fix(download): respect Content-Length when Content-Encoding is present #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 6, 2025

Conversation

ali90h
Copy link
Owner

@ali90h ali90h commented Aug 6, 2025

Summary

  • avoid false incomplete-download errors when servers gzip responses despite Accept-Encoding: identity
  • document how --download treats Content-Encoding

Testing

  • make test (fails: venv/bin/python: No such file or directory)
  • python -m pytest tests/test_downloads.py::TestDownloads::test_download_with_gzip_content_encoding -q

https://chatgpt.com/codex/tasks/task_e_68937afdead8832690ed1d25eb34b7c6

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 ali90h added the codex label Aug 6, 2025 — with ChatGPT Connector
@ali90h ali90h removed the codex label Aug 6, 2025
@ali90h ali90h merged commit 0e25939 into master 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