mhart / aws4

Signs and prepares Node.js requests using AWS Signature Version 4
MIT License
699 stars 175 forks source link

Undefined headers throw and error #134

Open Danwakeem opened 3 years ago

Danwakeem commented 3 years ago

Description

When I was using this on one of my services I have a collection of headers that I need to include when passing the request along to the downstream service. Sometimes these headers have a value and sometimes they do not.

When I attempted to generated a signed request with my customer headers this library was throwing an error because it was trying to do a .toString() on an undefined value.

I have an idea for a fix for this and can open a PR 👍 Feel free to let me know if there would be a more appropriate location for this fix 😎 Thank you!