fix: support private GitHub repos#6
Merged
Conversation
…oad_url GitHub's signed download_url for private repos already includes an access token as a query param. Sending an Authorization header alongside it triggers a CORS preflight on raw.githubusercontent.com that gets blocked with 403. Fall back to the API url + base64 decode only when download_url is null.
* Bumped version from 1.0.3 to 1.0.4 in both package.json and package-lock.json * Ensures consistency across project files
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
download_urlfor private repos includes an access token as a query param — sending anAuthorizationheader alongside it triggers a CORS preflight onraw.githubusercontent.comthat gets blocked with 403download_urlwithout auth headers; the signed token in the URL is sufficient for both public and private reposurlfield toGhFileinterface and a fallback path for the rare case wheredownload_urlisnull(fetches via API endpoint + base64 decode)Test plan