Repository navigation
fix: stop upload path segments from retargeting API requests - #1557
Merged
Merged
Conversation
Frontmatter slugs were placed unencoded in the v1 path, and the rest of the frontmatter was spread into the update body. Co-authored-by: Cursor <cursoragent@cursor.com>
[High impact] The latest change appears safe to merge. Reviews (5) · Last reviewed commit: "fix: bad nockmock" · Reviewed by Greptile |
erunion
marked this pull request as draft
November 10, 2026 23:50
Co-authored-by: Cursor <cursoragent@cursor.com>
v1.0-alpha is already one URL segment, so the branch check does not need a second grammar. Page sorting uses a Map so __proto__ and constructor stay real keys, and category URIs keep the raw branch. Co-authored-by: Cursor <cursoragent@cursor.com>
erunion
marked this pull request as ready for review
November 11, 2026 00:31
erunion
pushed a commit
that referenced
this pull request
Nov 11, 2026
## [10.10.1-next.2](v10.10.1-next.1...v10.10.1-next.2) (2026-11-11) ### Bug Fixes * stop upload path segments from retargeting API requests ([#1557](#1557)) ([f35a295](f35a295)) [skip ci]
Member
Author
|
🎉 This PR is included in version 10.10.1-next.2 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
erunion
pushed a commit
that referenced
this pull request
Nov 11, 2026
## [10.10.2-next.1](v10.10.1...v10.10.2-next.1) (2026-11-11) ### Bug Fixes * stop upload path segments from retargeting API requests ([#1557](#1557)) ([f35a295](f35a295)) [skip ci]
Member
Author
|
🎉 This PR is included in version 10.10.2-next.1 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
4 of 5 tasks
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
The hidden
rdme changelogscommand copied each file's frontmattersluginto/api/v1/changelogs/${slug}and spread the rest of the frontmatter into the update body.fetchresolves..and%2e%2ebefore the request is sent, so a slug such as../docs/victimcouldGETandPUTa different v1 resource in the same project.The same interpolation was still in the v2 page uploader and in OpenAPI upload. A frontmatter slug could retarget
GET/PATCHfor guides, reference, custom pages, and changelogs.--useSpecVersionputinfo.versionin/branches/${version}/apis, and--slug(or the inferred filename) was placed raw in/branches/${branch}/apis/${filename}.assertSluginsrc/lib/slug.tsrejects a value that is not one path segment, including percent-encoded dot segments,?,#, and ASCII controls. Request paths useencodeURIComponent. The error names the value as a slug or a branch.GETandPATCHencode the slug. The branch is encoded in the route and in normalized category and parent URIs.--branch, orinfo.versionwith--useSpecVersion) before listing definitions, and checks the filename after--slugand--legacy-idare applied. Both are encoded in the request URL. Matching and logs keep the raw values.title,type,hidden,metadata(description,image,keywords,title),body, andlastUpdatedHash.slugis set only on create. Dry run prints that body.Map, so a slug of__proto__is not stored on an object prototype.Test plan
npx vitest run test/lib/slug.test.ts test/commands/changelogs/index.test.ts test/commands/changelogs/single.test.ts test/commands/pages/upload.test.ts test/commands/changelog/upload.test.ts test/commands/openapi/upload.test.ts test/lib/ghaWorkflowCommands.test.ts../docs/victim,%2e%2e, orx?foo=1fails before any API request, including when a sibling file in the same directory is valid.100%is encoded in the path and sent raw in the create body.metadata.keywordsis sent.category,htmlmode, andparentDocSlugare not.../../stable/<route>/victimfails before that page or a sibling is requested.--branch ../projects/mefails before the page request. A slug of100%and a branch of1.0+betaare encoded in the path.openapi upload --useSpecVersionwithinfo.versionof../../projects/mefails before/branches/.../apis.openapi upload --slug ../secret.jsonfails after the branch listing and before the upload request.