Download release assets as binaries, not as JSON metadata - #114
Merged
Conversation
Upload-KiwixRelease.ps1 fetched each asset from its API URL without an Accept header, so GitHub returned the asset's JSON representation rather than the binary. Those ~1.5KB JSON files were then uploaded to the download server under a .zip name. Every published release there from 0.5 to 0.9 is affected; the GitHub release assets themselves are intact. The existing check only asked whether a file existed, so this always reported success. It now compares the downloaded size against the size the API reports, which is what would have caught this. Verified against the v0.9 asset: 1644 bytes before, 3582068 bytes after, matching the API and opening as a valid archive. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
🟢 Ready to approve
The changes directly address the reported failure mode by forcing binary downloads and adding a reliable integrity check without introducing risky behavior.
This review doesn't count toward merge requirements. Sign up for the private preview to control whether Copilot approvals count.
Pull request overview
Updates the Kiwix release upload PowerShell script to correctly download GitHub release assets as binary archives (instead of JSON metadata), aligning with the intent of Issue #113.
Changes:
- Use
browser_download_urlfor reporting the discovered asset URL. - Download assets via the GitHub API asset URL with
Accept: application/octet-streamto force binary content. - Validate successful downloads by comparing the downloaded file size to the API-reported
asset.size, and emit a more specific error when sizes differ.
File summaries
| File | Description |
|---|---|
| scripts/Upload-KiwixRelease.ps1 | Fixes release asset downloading to retrieve binary archives and verifies correctness via size comparison. |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 0
- Review effort level: Lite
We're testing this review assessment. Please use 👍 or 👎 to tell us if it's correct.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #113.
The existing check only asked whether a file existed, so this always reported success. It now compares the downloaded size against the size the API reports, which is what would have caught this.
Verified against the v0.9 asset: 1644 bytes before, 3582068 bytes after, matching the API and opening as a valid archive.