Skip to content

Commit 8c28831

Browse files
committed
fix: Remove multiValueQueryStringParameters Logic
1 parent 83ff70b commit 8c28831

File tree

2 files changed

+3
-19
lines changed

2 files changed

+3
-19
lines changed

src/adapters/helpers/lambdaEvent.ts

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,7 @@ export const lambdaEvent = (config: AlphaOptions, relativeUrl?: string) => {
1313
'http://fake',
1414
querystringWithArraySupport,
1515
);
16-
const params: Record<string, any> = Object.assign({}, parts.query, config.params);
17-
let multiValueParams: Record<string, any[]> | null = null;
18-
19-
const hasMultiValueParams = Object.values(params).some((value) => Array.isArray(value));
20-
21-
if (hasMultiValueParams) {
22-
Object.entries(params).forEach(([key, value]) => {
23-
multiValueParams = multiValueParams || {};
24-
if (Array.isArray(value)) {
25-
multiValueParams[key] = value;
26-
delete params[key];
27-
}
28-
});
29-
}
16+
const params = Object.assign({}, parts.query, config.params);
3017

3118
const httpMethod = (config.method as string).toUpperCase();
3219
const requestTime = new Date();
@@ -77,7 +64,7 @@ export const lambdaEvent = (config: AlphaOptions, relativeUrl?: string) => {
7764
userArn: null,
7865
},
7966
},
80-
multiValueQueryStringParameters: multiValueParams,
67+
multiValueQueryStringParameters: null,
8168
};
8269

8370
if (Buffer.isBuffer(event.body)) {

test/lambda-event.test.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,12 @@ test('Can parse URLs with duplicate parameters', () => {
3131
httpMethod: 'GET',
3232
path: '/lifeomic/dstu3/Questionnaire',
3333
queryStringParameters: {
34-
pageSize: '25',
35-
},
36-
multiValueQueryStringParameters: {
3734
_tag: [
3835
'http://lifeomic.com/fhir/questionnaire-type|survey-form',
3936
'http://lifeomic.com/fhir/dataset|0bb18fef-4e2d-4b91-a623-09527265a8b3',
4037
'http://lifeomic.com/fhir/primary|0343bfcf-4e2d-4b91-a623-095272783bf3',
4138
],
39+
pageSize: '25',
4240
},
4341
}));
4442
assertRequestId(result);
@@ -57,7 +55,6 @@ test('Can parse URLs without duplicates', () => {
5755
pageSize: '25',
5856
test: 'diffValue',
5957
},
60-
multiValueQueryStringParameters: null,
6158
}));
6259
assertRequestId(result);
6360
});

0 commit comments

Comments
 (0)