Repository navigation
Port app block asset path validation to Rust - #1402
Merged
Merged
Conversation
NathanPJF
marked this pull request as ready for review
November 16, 2026 20:11
EvilGenius13
approved these changes
Nov 16, 2026
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.
The Rust app-block asset size checks still accept paths outside the assets directory, while TypeScript rejects them after #1389. This causes 16 shared-spec failures in the Rust CI job on release PR #1401: for example,
../secret.txtproduces a size or missing-file offense instead of an invalid asset-name offense.Port TypeScript’s
isAssetFileNameguard using the existing Rust URI helpers. Both CSS and JavaScript checks now reject separators, decoded separators, dot paths and names whose resolved parent is not the assets directory, before checking file existence or reading its size. Offense messages and spans match TypeScript. Includes a patch changeset for the Rust crates.Validation:
cargo test --workspace --lockedpasses, including check specs 1824/1824, parser specs 541/541, graph specs 15/15 and Liquid/Ruby parity 3600/3600. One existing unit test remains ignored.cargo fmt --all -- --checkandcargo clippy --workspace --all-targets --locked -- -D warningspass.cargo publish --dry-run --workspace --lockedpasses; nothing was published.crates/theme-check/package.json;git diff --checkpasses.The existing shared specifications from #1389 cover the regressions; this PR changes only the Rust implementation and its release changeset. TypeScript/browser tests were not run locally. This resolves the diagnosed Rust-spec failure; it does not establish that every release CI job is green.