Skip to content

fix: support for compressed content in download2stream method. #353

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
Apr 28, 2025

Conversation

bigcat88
Copy link
Member

Fixes #352 .

By switching from iter_raw to iter_bytes, httpx will automatically handle the decompression if the Content-Encoding: gzip header is present. If the header is absent or specifies no compression (like identity), iter_bytes will yield the original bytes, just like iter_raw would have.

Signed-off-by: bigcat88 <bigcat88@icloud.com>
Copy link

codecov bot commented Apr 28, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.13%. Comparing base (57c6d34) to head (c224f43).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #353   +/-   ##
=======================================
  Coverage   95.13%   95.13%           
=======================================
  Files          45       45           
  Lines        5325     5325           
=======================================
  Hits         5066     5066           
  Misses        259      259           
Files with missing lines Coverage Δ
nc_py_api/_session.py 94.20% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@bigcat88 bigcat88 merged commit fd28177 into main Apr 28, 2025
13 checks passed
@bigcat88 bigcat88 deleted the fix/352 branch April 28, 2025 13:23
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.

nc.files.download2stream - corupted file bytes
1 participant