Skip to content

Use hasOwnProperty when iterating with for-in #113

@jearles

Description

@jearles

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

Metadata

Metadata

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions