From 79ebfc8a24c5e1e4b1e77432a5d7e1292cb18ee2 Mon Sep 17 00:00:00 2001 From: Claude Bot Date: Thu, 12 Feb 2026 07:17:17 +0000 Subject: [PATCH] test: rename to issue number and improve filename regex - Rename test file to 26959.test.ts per regression test convention - Fix Content-Disposition regex to match filename parameter anywhere in the header value, not just as the entire value - Assert the regex match is found before checking captured group Co-Authored-By: Claude --- ...jection-content-disposition.test.ts => 26959.test.ts} | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) rename test/regression/issue/{header-injection-content-disposition.test.ts => 26959.test.ts} (93%) diff --git a/test/regression/issue/header-injection-content-disposition.test.ts b/test/regression/issue/26959.test.ts similarity index 93% rename from test/regression/issue/header-injection-content-disposition.test.ts rename to test/regression/issue/26959.test.ts index 8a5797f05d..19608ed205 100644 --- a/test/regression/issue/header-injection-content-disposition.test.ts +++ b/test/regression/issue/26959.test.ts @@ -47,11 +47,10 @@ test("Content-Disposition header injection via quotes in File name", async () => if (contentDisposition) { expect(contentDisposition).not.toContain("\r"); expect(contentDisposition).not.toContain("\n"); - // The inner filename value should not contain unescaped double quotes - const match = contentDisposition.match(/^filename="(.*)"$/); - if (match) { - expect(match[1]).not.toContain('"'); - } + // The filename parameter value should not contain unescaped double quotes + const match = contentDisposition.match(/filename="([^"]*)"/); + expect(match).not.toBeNull(); + expect(match![1]).not.toContain('"'); } expect(body).toBe("hello");