fix: replace WebClient with Invoke-WebRequest, fix ARM64 arch name#7
Open
jimbb wants to merge 1 commit into
Open
fix: replace WebClient with Invoke-WebRequest, fix ARM64 arch name#7jimbb wants to merge 1 commit into
jimbb wants to merge 1 commit into
Conversation
- Replace WebClient.DownloadFile/DownloadFileAsync with Invoke-WebRequest in Invoke-PackageDownload to fix GitHub CDN redirect compatibility issue that caused silent update failures - Fix Get-SystemArchitecture to return 'aarch64' instead of 'arm64' for ARM64 systems, matching the actual release asset naming convention - Use background PowerShell runspace with marquee progress bar for async download with UI feedback Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Summary
WebClient.DownloadFile/DownloadFileAsyncwithInvoke-WebRequestinInvoke-PackageDownload.WebClientfails to handle GitHub CDN redirects reliably, causing silent update failures (theversions/vX.Y.Z/directory gets created but remains empty).Invoke-WebRequesthandles the redirect chain correctly.Get-SystemArchitecturereturned"arm64"but CLIProxyAPI release assets use"aarch64"(e.g.CLIProxyAPI_7.1.32_windows_aarch64.zip), causing ARM64 users to always fail asset lookup with "Asset not found".WebClientasync events (percentage bar) to a background PowerShell runspace + marquee progress bar with downloaded MB polling.Root cause
WebClientusesHttpWebRequestunder the hood and fails on GitHub's CDN redirect chain even when TLS 1.2 is explicitly set.Invoke-WebRequesthandles the same redirects correctly.