rack-attack 0.2.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of rack-attack might be problematic. Click here for more details.
- data/README.md +1 -1
- data/lib/rack/attack.rb +1 -1
- data/lib/rack/attack/version.rb +1 -1
- data/spec/rack_attack_spec.rb +1 -1
- metadata +2 -2
data/README.md
CHANGED
@@ -129,4 +129,4 @@ Thanks to [Kickstarter](https://github.com/kickstarter) for sponsoring Rack::Att
|
|
129
129
|
|
130
130
|
Copyright (c) 2012 Kickstarter, Inc
|
131
131
|
|
132
|
-
Released under an
|
132
|
+
Released under an [MIT License](http://opensource.org/licenses/MIT)
|
data/lib/rack/attack.rb
CHANGED
@@ -35,7 +35,7 @@ module Rack::Attack
|
|
35
35
|
@blacklisted_response ||= lambda {|env| [503, {}, ['Blocked']] }
|
36
36
|
@throttled_response ||= lambda {|env|
|
37
37
|
retry_after = env['rack.attack.match_data'][:period] rescue nil
|
38
|
-
[503, {'Retry-After' => retry_after}, ['Retry later']]
|
38
|
+
[503, {'Retry-After' => retry_after.to_s}, ['Retry later']]
|
39
39
|
}
|
40
40
|
|
41
41
|
self
|
data/lib/rack/attack/version.rb
CHANGED
data/spec/rack_attack_spec.rb
CHANGED
@@ -93,7 +93,7 @@ describe 'Rack::Attack' do
|
|
93
93
|
last_request.env['rack.attack.match_data'].must_equal({:count => 2, :limit => 1, :period => 1})
|
94
94
|
end
|
95
95
|
it 'should set a Retry-After header' do
|
96
|
-
last_response.headers['Retry-After'].must_equal 1
|
96
|
+
last_response.headers['Retry-After'].must_equal '1'
|
97
97
|
end
|
98
98
|
end
|
99
99
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rack-attack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-08-02 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rack
|