fix(downloader): correct resume progress and avoid httpx private API

Two bugs found by code review:

1. Progress bar exceeds 100% on resumed downloads because
   Content-Length from a Range response covers only remaining
   bytes. Now adds resume_from for the true total.

2. session.transport reached into httpx.Client._transport, a
   private attribute that may break on httpx upgrades. Transport
   is now stored at construction time instead.
This commit is contained in:
AlexKucera committed 2026-06-06 09:28:33 +02:00
1 parent 2466ef5fa8
commit 8acea390e6
4 files changed
+21 -5

No files matched your search

+2 -1
View File
@@ -712,7 +712,8 @@ class TestTransportProperty:
password="p",
)
assert session.transport is session._client._transport
# Default transport is None when not injected
assert session.transport is None
def test_returns_injected_mock_transport(self):
"""When a MockTransport is injected, session.transport returns it."""