Open kentmw opened 9 years ago
I had to write a work around in my code:
var limiterCreator = require('express-limiter')(app, client);
function recreateLimiter(opts) {
return function() {
var limiter = limiterCreator(_.extend({}, opts));
return limiter.apply(this, arguments);
}
}
Maybe I'm missing something really obvious but the fact that the limiter only gets created once and the original opts object is modified on subsequent calls seems like bad news. Perhaps cloning the opts at the beginning using underscore could mitigate this problem.
i gotcha. i'll have a look to see what we can do about that
@kentmw , @ded : I had the same issue. I create a pull request to fix this issue. (https://github.com/ded/express-limiter/pull/21)
@kentmw : Meanwhile the merge or another fix you may use my fork. ;)
@vamonte: Your code worked. @ded: Why don't you merge @vamonte's PR?
@ded Thank's for the merge. Do you know when you're going to tag the next release? I would like to use this package in an automated build.
@vamonte ++
@vamonte ++ @ded just a reminder to tag the release.
@vamonte ++ @ded We are also looking to use this package in an automated build in the near future, so a new tag would be much appreciated.
New release please @ded
Just ran into this too, any word on a new release @ded?
Is this fixed now, per #21?
I "consoled" the block about the lookup option being a function:
Then I booted the server:
Then I ran the first request:
Then I ran the second request:
Notice the second go console log 2 has been updated to what was console log 3's.