dougmoscrop / serverless-http

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

Don't set requestId header to undefined when the header is not present #169

Closed mpvosseller closed 3 years ago

mpvosseller commented 4 years ago

Updates the code so we don't set the requestId header (x-request-id) to undefined when the header is not present.

This seems cleaner and fixes a bug that can occur in other code that might assume each set header will have a defined value. The koa2-winston package for example assumes all headers have a defined value and crashes when that is not the case.

Usually this is not a problem because API Gateway provides the x-request-id header. It is a problem however when running locally or when invoking a lambda directly with a hand crafted http event that don't have that header.

mpvosseller commented 3 years ago

hey @dougmoscrop, any chance you'd consider this one and maybe doing a release with the previously merged PRs? If there is something I can do to help please let me know.

dougmoscrop commented 3 years ago

yep sorry