lambda-api icon indicating copy to clipboard operation
lambda-api copied to clipboard

Use hasOwnProperty when iterating with for-in

Open jearles opened this issue 6 years ago • 0 comments

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

jearles avatar May 25 '19 03:05 jearles