From 9b8d67e9324f10a3ad436bae54c8e1f05c08cdbc Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Tue, 10 Feb 2026 02:43:55 +0000 Subject: [PATCH] Handle uppercase absolute request URL schemes Co-authored-by: Theo Browne --- apps/t3/src/cli.test.ts | 8 ++++++++ apps/t3/src/cli.ts | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/apps/t3/src/cli.test.ts b/apps/t3/src/cli.test.ts index 378cce56d0..d2b093d880 100644 --- a/apps/t3/src/cli.test.ts +++ b/apps/t3/src/cli.test.ts @@ -840,6 +840,14 @@ describe("resolveStaticAssetPath", () => { }); }); + it("supports uppercase absolute-form request target schemes", () => { + const result = resolveStaticAssetPath("HTTP://127.0.0.1/assets/main.js?x=1", distRoot); + expect(result).toEqual({ + kind: "file", + filePath: path.join(distRoot, "assets", "main.js"), + }); + }); + it("rejects malformed absolute-form request targets", () => { const result = resolveStaticAssetPath("http://%zz", distRoot); expect(result).toEqual({ diff --git a/apps/t3/src/cli.ts b/apps/t3/src/cli.ts index ad6955e89f..64c2a455b1 100644 --- a/apps/t3/src/cli.ts +++ b/apps/t3/src/cli.ts @@ -526,7 +526,7 @@ export function resolveStaticAssetPath( return "/"; } - if (requestUrl.startsWith("http://") || requestUrl.startsWith("https://")) { + if (/^https?:\/\//i.test(requestUrl)) { try { return new URL(requestUrl).pathname; } catch {