Repository navigation
fix(download): Ignore an unusable GitHub token and keep it on redirects - #6826
Merged
Merged
Conversation
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.
Description
gh_tokenthat is invalid or expired no longer aborts the download of a public release asset. The asset is downloaded anonymously and a warning is shown.api.github.com.URL ... is not valid.Motivation and Context
gh_tokenmakes downloads fail #6825How Has This Been Tested?
The full test suite was run on Windows PowerShell 5.1 and PowerShell 7, together with the new unit tests for the token handling. The fix was verified against the GitHub API with a misconfigured
gh_token: the query fails with 401, a warning is shown and the asset is downloaded anonymously. With a valid token a renamed repository is resolved with the token still attached (X-RateLimit-Limit: 5000instead of 60), and the hash lookups were checked on both PowerShell versions.Checklist:
developbranch.

Confidence Score: 5/5
The PR appears safe to merge; the previous text-decoding issue is fixed.Summary
The PR lets public release downloads continue when a GitHub token cannot be used. It also keeps the token on redirects within the GitHub API.
Reviews (3) · Last reviewed commit: "fix(download): Read the charset of a htt..." · Reviewed by Greptile