rack-throttle 0.4.2 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/lib/rack/throttle/daily.rb +1 -1
- data/lib/rack/throttle/hourly.rb +1 -1
- data/lib/rack/throttle/minute.rb +1 -1
- data/lib/rack/throttle/second.rb +1 -1
- data/lib/rack/throttle/time_window.rb +1 -1
- data/lib/rack/throttle/version.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7823180e20dd3ab553a305842fb9f785894953bd
|
4
|
+
data.tar.gz: 9781b73ca8565c8f9123d6100e6fd7729c707d5b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0a0828b9d713cb79ba08b694e9163bc22acd86b763b16cd054afb37f3e04ea938fa34c1757d01f4cd2e546b3bda196bc83f0777d232744fb7b098409da9c5461
|
7
|
+
data.tar.gz: afc4bb326fb276937dde75cb37db310313e5c87c4d134cef3b25bb4e3dc53ea453e1913514109c35ab58792b40a72897840964a8286aee0fc4a3d956b15e50f4
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.5.0
|
data/lib/rack/throttle/daily.rb
CHANGED
data/lib/rack/throttle/hourly.rb
CHANGED
data/lib/rack/throttle/minute.rb
CHANGED
data/lib/rack/throttle/second.rb
CHANGED
@@ -10,7 +10,7 @@ module Rack; module Throttle
|
|
10
10
|
def allowed?(request)
|
11
11
|
return true if whitelisted?(request)
|
12
12
|
count = cache_get(key = cache_key(request)).to_i + 1 rescue 1
|
13
|
-
allowed = count <= max_per_window.to_i
|
13
|
+
allowed = count <= max_per_window(request).to_i
|
14
14
|
begin
|
15
15
|
cache_set(key, count)
|
16
16
|
allowed
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rack-throttle
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Arto Bendiken
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-02-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|