From e0089ea5c752ffac32568fb5066448865211a2e6 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Tue, 10 Feb 2026 01:53:56 +0000 Subject: [PATCH] Cover query-plus-fragment static path parsing Co-authored-by: Theo Browne --- apps/t3/src/cli.test.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/apps/t3/src/cli.test.ts b/apps/t3/src/cli.test.ts index a12e0243a6..fe2a93adc5 100644 --- a/apps/t3/src/cli.test.ts +++ b/apps/t3/src/cli.test.ts @@ -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({