strongloop/loopback — pull request #341 by STRML (2014-06-20 21:43:38+00:00)
Title: Fix a slowdown caused by mutation of an incoming accessToken option.

When any options are provided to `loopback.token()`, they are mutated by `models/access-token.js` upon every request, leading to steadily increasing memory usage and a gradual slowdown as the number of headers/params/cookies checked increases linearly with every request.

After just a few requests, you might end up with the following:
![Imgur](http://i.imgur.com/lFnCjwZ.png?1)

Rather than mutating the incoming option, this PR creates a new array.