tunnckoCore / koa-better-ratelimit

:rocket: Smart and easy request rate limiter for your APIs built on `koa`, using `koa-ip-filter`. Support custom stores, custom ID, custom error messages and custom headers.
http://j.mp/1stW47C
MIT License
38 stars 6 forks source link

Multiple clients #2

Closed roryf closed 10 years ago

roryf commented 10 years ago

Perhaps I'm being really stupid, but this line index.js#L95 seems to suggest only adjacent requests from the same IP will be rate limited. If another request comes in from another IP address, previous rate limit records will be ignored and a new one created.

I couldn't figure out an easy way to write a test for this.

tunnckoCore commented 10 years ago

Good point. Got it, i'll change it later. And will write test for this case.