Skip to content

Commit b59291a

Browse files
authored
Remove search params duplication (#81)
* fix: remove search params duplication * chore: add changeset * fix: fix test casec
1 parent 56e516a commit b59291a

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

.changeset/chilled-penguins-share.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@as-integrations/aws-lambda': patch
3+
---
4+
5+
fix search params duplication

src/__tests__/mockAPIGatewayV1Server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ function v1EventFromRequest(shouldBase64Encode: boolean) {
2222
const multiValueQueryStringParameters: Record<string, string[]> = {};
2323
for (const [key] of searchParams.entries()) {
2424
const all = searchParams.getAll(key);
25-
if (all.length > 1) {
25+
if (all.length !== 0) {
2626
multiValueQueryStringParameters[key] = all;
2727
}
2828
}

src/request-handlers/APIGatewayProxyEventRequestHandler.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,6 @@ export const createAPIGatewayProxyEventRequestHandler = <
3434
},
3535
parseQueryParams(event) {
3636
const params = new URLSearchParams();
37-
for (const [key, value] of Object.entries(
38-
event.queryStringParameters ?? {},
39-
)) {
40-
params.append(key, value ?? '');
41-
}
4237
for (const [key, value] of Object.entries(
4338
event.multiValueQueryStringParameters ?? {},
4439
)) {

0 commit comments

Comments
 (0)