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.
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.
Updates the code so we don't set the
requestId
header (x-request-id
) toundefined
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.