Cover query-plus-fragment static path parsing

Co-authored-by: Theo Browne <[email protected]>
This commit is contained in:
Cursor AgentandTheo Browne committed 2026-02-10 01:53:56 +00:00
1 parent 01021f85df
commit e0089ea5c7
1 file changed
+8
+8
View File
@@ -584,6 +584,14 @@ describe("resolveStaticAssetPath", () => {
});
});
it("strips query strings before hash fragments when resolving paths", () => {
const result = resolveStaticAssetPath("/assets/main.js?v=123#chunk", distRoot);
expect(result).toEqual({
kind: "file",
filePath: path.join(distRoot, "assets", "main.js"),
});
});
it("rejects traversal attempts with decoded dot-dot segments", () => {
const result = resolveStaticAssetPath("/../package.json", distRoot);
expect(result).toEqual({