Repository navigation
Conversation
fetchGitHubFile and the relative logo URL interpolated tree paths into the raw URL as they came from the GitHub tree API, unencoded. A path with a # stopped at the fragment, a ? at the query, and a % was read as a broken escape, so a rule such as rules/c#.mdc fetched rules/c, got a 404, and was dropped from the import without a message. A sub-plugin directory with such a character lost its plugin.json the same way. Each path segment is now percent-encoded and the slashes between them kept, through one rawGitHubUrl helper used by both call sites. Plain paths produce the same URL as before.
This branch has not been deployed
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.
What
fetchGitHubFileinlib/github-plugin/parse.tsbuilds the raw-content URL by interpolating the tree path as it comes from the GitHub tree API, which is not percent-encoded:A
#in the path starts a URL fragment, a?a query, and a%a malformed escape.rules/c#.mdcis requested as.../rules/c, gets a 404,fetchGitHubFilereturnsnull, and the rule is skipped without a message. A sub-plugin directory with such a character loses itsplugin.jsonthe same way, and the relativelogopath is built with the same template.Checked against a live repo:
flyeric0212/cursor-ruleshaslanguages/c#.mdc. The unencoded URL returns 404 at/languages/c; the segment-encoded URL returns 200. Plain paths (README.md,.cursor-plugin/marketplace.json,advisor/.cursor-plugin/plugin.jsononcursor/plugins) return the same status either way.This is the fetch-side sibling of #467, which escapes the directory prefix when matching the tree. The two touch different hunks of the file and merge cleanly together.
Fix
One
rawGitHubUrl(owner, repo, path)helper percent-encodes each path segment and keeps the slashes between them, used byfetchGitHubFileand by the relative-logo branch. Plain paths produce the same URL as before.The repo has no test runner.
tsc --noEmit -p apps/cursor/tsconfig.jsonreports the same single pre-existing error asmain(platforminAgentOptionsinscan.ts) and nothing new;biome checkon the file is clean.