The current query string translation logic doesn't distinguish between repeated query string values (i.e. &key=a&key=b) and values that contain URL encoded literal commas (i.e. &key=a%2Cb). The former should map to a fastify array value, the latter should not. It appears the API GW V2.0 event format has this same hazard.
The two cases could be distinguished by parsing the rawQueryString value (or for performance reasons, doing this only when a potential split is detected).
|
if (event.queryStringParameters && event.version === '2.0') { |
The current query string translation logic doesn't distinguish between repeated query string values (i.e.
&key=a&key=b) and values that contain URL encoded literal commas (i.e.&key=a%2Cb). The former should map to a fastify array value, the latter should not. It appears the API GW V2.0 event format has this same hazard.The two cases could be distinguished by parsing the
rawQueryStringvalue (or for performance reasons, doing this only when a potential split is detected).aws-lambda-fastify/index.js
Line 65 in 2e9387b