Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: bezzad/Downloader
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: bezzad/Downloader
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: fix/issue-236-gzip-content-truncation
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 1 commit
  • 4 files changed
  • 2 contributors

Commits on Jul 9, 2026

  1. fix: don't truncate downloads when a caller-supplied HttpClient auto-…

    …decompresses content (#236)
    
    Content-Length/Content-Range describe the size of the compressed wire
    representation (RFC 9110 §8.6), not the decompressed byte count that a
    caller's HttpClient (via CustomHttpClientFactory + AutomaticDecompression)
    transparently delivers. ChunkDownloader.ReadStream clamps reads to the
    chunk's declared remaining length, so once that (too-small) length was
    reached the rest of the decompressed stream was silently dropped -- no
    exception, no retry, just a truncated file.
    
    SocketClient now detects a non-identity Content-Encoding on the probe
    response and treats the size as unknown + range unsupported, routing the
    download through the existing single-connection/unknown-size path (#230)
    instead of chunking against the wrong total. This also sidesteps a deeper
    problem: Range requests address offsets in the *compressed* bitstream, so
    splitting a compressed representation into parallel chunks is not
    generally decodable past the first chunk regardless of size accounting.
    
    Added Issue236Test + a gzip-compressed dummy-server endpoint to reproduce
    and verify the fix.
    
    Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
    bezzad and claude committed Jul 9, 2026
    Configuration menu
    Copy the full SHA
    7ccab97 View commit details
    Browse the repository at this point in the history
Loading