From 8f821b791a9c39fabd4e26bef66f02ae576758b2 Mon Sep 17 00:00:00 2001 From: Andrew Barba Date: Fri, 24 Jan 2025 09:45:44 -0500 Subject: [PATCH] bun-lambda: fix http v2 event query parsing (#16684) --- packages/bun-lambda/runtime.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/packages/bun-lambda/runtime.ts b/packages/bun-lambda/runtime.ts index f5de8a7e1c901d..791624b52b880e 100755 --- a/packages/bun-lambda/runtime.ts +++ b/packages/bun-lambda/runtime.ts @@ -364,17 +364,15 @@ function formatHttpEventV2(event: HttpEventV2): Request { headers.append(name, value); } } - for (const [name, values] of Object.entries(event.queryStringParameters ?? {})) { - for (const value of values.split(",")) { - headers.append(name, value); - } - } for (const cookie of event.cookies ?? []) { headers.append("Set-Cookie", cookie); } const hostname = headers.get("Host") ?? request.domainName; const proto = headers.get("X-Forwarded-Proto") ?? "http"; const url = new URL(request.http.path, `${proto}://${hostname}/`); + for (const [name, values] of Object.entries(event.queryStringParameters ?? {})) { + url.searchParams.append(name, values); + } return new Request(url.toString(), { method: request.http.method, headers,