You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Files downloaded using version v4.0.3 are corrupted and cannot be downloaded completely. This issue does not occur in v3.3.4, which works as expected.
Steps to Reproduce:
Use application version v4.0.3.
Try downloading a file from a GitHub raw URL, for example: https://raw.githubusercontent.com/ghost1372/App-Resources/refs/heads/main/AlAnvar/Translations/fa.ansarian.json
Observe that the downloaded file is incomplete or corrupted.
Expected Behavior:
The file should be downloaded fully and remain intact.
Actual Behavior:
The downloaded file is corrupted or incomplete in v4.0.3.
Additional Notes:
Downgrading to v3.3.4 resolves the issue; downloads work correctly in that version.
This corruption happens when downloading from GitHub raw (and similar servers) using multi-chunk / ranged downloads while the client advertises compression (e.g. Accept-Encoding: gzip, deflate, br). In that scenario the server may respond with Content-Encoding: gzip, and each chunk becomes a range of a compressed stream, which can’t be safely reassembled/decompressed per chunk — resulting in corrupted output (and sometimes an InvalidDataException, depending on where decompression occurs).
The previous suggestion about AutomaticDecompression was directionally correct, but it didn’t fully solve the issue in practice because Downloader was still forcing a default Accept-Encoding via HttpClient.DefaultRequestHeaders (hardcoded). That could override user changes like setting Accept-Encoding: identity, causing the problem to reappear.
Fix
I updated the default header handling so that Accept-Encoding is no longer forced in a way that breaks ranged downloads (and user-provided values like identity are respected). With this change, GitHub raw downloads should no longer be corrupted when using multiple chunks.
Test build
I’ve published a new version v4.1.0 for you to test. Please update to the latest package and retry the same URL.
If it now downloads as incorrect, please share the response headers (Content-Encoding, Accept-Ranges, Content-Range) and your downloader configuration so I can reproduce it exactly.
Activity
Tartilla-TAIGO commentedon Dec 22, 2025
Good afternoon, I'm seeing the same problem, but I additionally check the files for the hash amount and redownload them if they are corrupted.
fix: issue Downloaded files are corrupted in v4.0.3 #206
bezzad commentedon Feb 8, 2026
I'm so sorry I tried to edit my answer, but I clicked delete and it was deleted!
No problem. I'm looking into why this happened.
ghost1372 commentedon Feb 8, 2026
Hopefully all GitHub notifications are being sent to my email. Here’s your previous comment:
bezzad commentedon Feb 9, 2026
@ghost1372 @Tartilla-TAIGO
Thanks for the detailed report.
This corruption happens when downloading from GitHub raw (and similar servers) using multi-chunk / ranged downloads while the client advertises compression (e.g.
Accept-Encoding: gzip, deflate, br). In that scenario the server may respond withContent-Encoding: gzip, and each chunk becomes a range of a compressed stream, which can’t be safely reassembled/decompressed per chunk — resulting in corrupted output (and sometimes anInvalidDataException, depending on where decompression occurs).Previous workaround
The previous suggestion about
AutomaticDecompressionwas directionally correct, but it didn’t fully solve the issue in practice because Downloader was still forcing a defaultAccept-EncodingviaHttpClient.DefaultRequestHeaders(hardcoded). That could override user changes like settingAccept-Encoding: identity, causing the problem to reappear.Fix
I updated the default header handling so that
Accept-Encodingis no longer forced in a way that breaks ranged downloads (and user-provided values likeidentityare respected). With this change, GitHub raw downloads should no longer be corrupted when using multiple chunks.Test build
I’ve published a new version v4.1.0 for you to test. Please update to the latest package and retry the same URL.
If it now downloads as incorrect, please share the response headers (
Content-Encoding,Accept-Ranges,Content-Range) and your downloader configuration so I can reproduce it exactly.ghost1372 commentedon Feb 9, 2026
Thank you @bezzad i can confirm it is working fine now.