RequestRateThrottleFilter may not work as expected with hits=1 or hits=2
Description
Activity

Max Gelman November 13, 2014 at 6:27 PM
From kevin.w.wall@gmail.com on September 18, 2014 13:51:20
Disregard previous comment. Won't fix 141.

Max Gelman November 13, 2014 at 6:27 PM
From eric.cit...@gmail.com on January 03, 2014 06:56:50
Thank you for your reply.
IMHO, hits=1 is a valid value. The way I understand it is that "you can do no more than 1 request in any period of 2 seconds". In other words: you just made a request, fine! now wait for 2 seconds before making another one.

Max Gelman November 13, 2014 at 6:27 PM
From kevin.w.wall@gmail.com on January 22, 2014 22:45:25
Eric,
Would you like this work to be considered for the ESAPI hackathon contest? If so, please email me ASAP. Thanks.
-kevin wall <kevin.w.wall@gmail.com>

Max Gelman November 13, 2014 at 6:27 PM
From kevin.w.wall@gmail.com on September 18, 2014 13:49:52
See related issue # 141.

Max Gelman November 13, 2014 at 6:27 PM
From kevin.w.wall@gmail.com on January 01, 2014 21:25:37
I think that there's an implicit assumption that 'hits' would never be configured to be set to one as that would mean that no request could be made at all within any time period, but you have a valid point for when 'hits' is 2.
I've not yet scrutinized your patch in any depth, but this is also the first time that I've really took anything more than a very superficial look at RequestRateThrottleFilter. That said, your patch is more in line with how I would have written this. I will take a look at it when I get a bit more time. Thanks.
From eric.cit...@gmail.com on January 01, 2014 13:11:08
As stated in my comment ( https://code.google.com/p/owasp-esapi-java/source/browse/trunk/src/main/java/org/owasp/esapi/filters/RequestRateThrottleFilter.java?spec=svn1940&r=1940ESAPILEG-86 ), RequestRateThrottleFilter may not work as expected when configured with hits=1 or hits=2.
I would like to suggest another implementation (see the attached patch).
Thanks,
Eric.
Attachment: RequestRateThrottleFilter.patch
Original issue: http://code.google.com/p/owasp-esapi-java/issues/detail?id=317