dougmoscrop / serverless-http

Use your existing middleware framework (e.g. Express, Koa) in AWS Lambda 🎉
Other
1.71k stars 164 forks source link

URIError: URI malformed #204

Closed zoellner closed 2 years ago

zoellner commented 3 years ago

Running into an issue when a URL has some malformed components when using behind an AWS Elastic Load Balancer.

Example: any url with query string parameter utm_term=%%URL%%

Outcome: Throws Error

URIError: URI malformed 
at decodeURIComponent (<anonymous>) 
at specialDecodeURIComponent (/var/task/node_modules/serverless-http/lib/provider/aws/clean-up-event.js:28:10) 
at recursiveURLDecode (/var/task/node_modules/serverless-http/lib/provider/aws/clean-up-event.js:34:12) 
at recursiveURLDecode (/var/task/node_modules/serverless-http/lib/provider/aws/clean-up-event.js:50:55) 
at cleanupEvent (/var/task/node_modules/serverless-http/lib/provider/aws/clean-up-event.js:75:37) 
at /var/task/node_modules/serverless-http/lib/provider/aws/index.js:8:19 

Expected Outcome: Will properly handle that query string parameter without throwing an error.