cherry-pick: Fix static plugin serving nothing when urlPath is configured (conflicts → v5.1)#1739
Open
github-actions[bot] wants to merge 5 commits into
Open
cherry-pick: Fix static plugin serving nothing when urlPath is configured (conflicts → v5.1)#1739github-actions[bot] wants to merge 5 commits into
github-actions[bot] wants to merge 5 commits into
Conversation
Two stacked defects: the Scope server proxy passed the raw config value
('assets') as the route mount, which can never match leading-slash
pathnames; and the routing chain strips the mount prefix from
req.pathname while the static maps were keyed by the full entry URL
path. normalizeUrlPath now ensures a leading slash, the Scope proxy
resolves urlPath via resolveBaseURLPath (same normalization as the
entry pipeline), and static.ts keys its maps relative to the mount
base captured at registration. urlPath runtime changes now request a
restart (the route mount cannot be re-registered live), and the mount
root disambiguates the no-slash form via the unstripped request so
the root index 301s to the trailing-slash path.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…oot disambiguation Codex review: BunRequest sets _nodeRequest to null, so the mount-root redirect silently never fired on Bun. stripPrefix now exposes the unstripped pathname as an explicit property instead of handlers reaching into runtime internals. Verified on both runtimes. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Gemini review: both 301 Location headers dropped the original query string. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Keep the common index-serve path (200, no redirect) allocation-free by computing queryIndex/query lazily inside each 301 branch instead of unconditionally on every index request. Static serving is in the request hot path. Follow-up to review on #1584. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
no-restricted-imports bans the node:assert/strict subpath; node:assert exports the same strictEqual/ok. Unblocks runLinter on #1584. Co-Authored-By: Claude Opus 4.8 (1M context) <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.
Cherry-pick of PR #1584 onto `v5.1` produced conflicts on commit(s): `21d022b5408705280ffcb829b9c041427b61233b eb6631d aae9a11 24ef8e9 ebff1f4 a2e9a63`.
Resolve the conflict markers on branch `cherry-pick/v5.1/pr-1584` and merge this PR.
@claude please review branch `cherry-pick/v5.1/pr-1584` and suggest a patch that resolves the conflict markers (
<<<<<<</=======/>>>>>>>) introduced by cherry-picking PR #1584 onto `v5.1`. Post the suggested patch as a comment here — do not push.