lambda-api
lambda-api copied to clipboard
Use hasOwnProperty when iterating with for-in
In the use method you are using a rest operator to pull all parameters into an array for processing. However, when processing the middleware you are using for-in:
https://github.com/jeremydaly/lambda-api/blob/master/index.js#L347
As you do not use hasOwnProperty this method is prone to picking up prototype methods. A recent library we used added a Array prototype method and our routes broke with:
ConfigurationError: Middleware must have 3 or 4 parameters