rack-attack 4.0.0 → 4.0.1

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.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ff9b10f54b7093a546fea83332521abbd15b50fc
4
- data.tar.gz: 766a4136c3895f45c09288e9fc97fe4a5e8e596c
3
+ metadata.gz: b2ad64c34913ec247b9f1952ec77a38762742151
4
+ data.tar.gz: f953e23413add27445c65ef5d058afc0c5dc2cb7
5
5
  SHA512:
6
- metadata.gz: d5891f076087208013f1df9942977692aec45692ac6ec6fea1d143731033bebeed08d955a977ac7322aed8c9390383557214891ea61344351b1d1ec04c5f897e
7
- data.tar.gz: d6e5098b06db042fb7e863b7d34668d4f5bff12812d7ee1d7493455ca8546606605431ebd403041442ee82f47509ad8c2365a2a2bcd130706c3a328a74dc94ed
6
+ metadata.gz: e2c8ebf7e34dae93d31c300ca035723794f1f185fecaa008fdf1f305697c6d1f36614ae6e5c1135be3722cbfd68b7ea1ef809d6f045f7858e6674dca837cbcc0
7
+ data.tar.gz: 6b8d3632cae6db709922e400e681b7e0742067baaf3596957af962ab13be55a5a445fee534b40279ae19ab3f50ae2cd8776d473359e06d8889c4b8b5e0b3dab0
@@ -32,9 +32,10 @@ module Rack
32
32
 
33
33
  (count > current_limit).tap do |throttled|
34
34
  if throttled
35
- req.env['rack.attack.matched'] = name
36
- req.env['rack.attack.match_type'] = :throttle
37
- req.env['rack.attack.match_data'] = data
35
+ req.env['rack.attack.matched'] = name
36
+ req.env['rack.attack.match_discriminator'] = discriminator
37
+ req.env['rack.attack.match_type'] = :throttle
38
+ req.env['rack.attack.match_data'] = data
38
39
  Rack::Attack.instrument(req)
39
40
  end
40
41
  end
@@ -1,5 +1,5 @@
1
1
  module Rack
2
2
  class Attack
3
- VERSION = '4.0.0'
3
+ VERSION = '4.0.1'
4
4
  end
5
5
  end
@@ -32,6 +32,7 @@ describe 'Rack::Attack.throttle' do
32
32
  last_request.env['rack.attack.matched'].must_equal 'ip/sec'
33
33
  last_request.env['rack.attack.match_type'].must_equal :throttle
34
34
  last_request.env['rack.attack.match_data'].must_equal({:count => 2, :limit => 1, :period => @period})
35
+ last_request.env['rack.attack.match_discriminator'].must_equal('1.2.3.4')
35
36
  end
36
37
  it 'should set a Retry-After header' do
37
38
  last_response.headers['Retry-After'].must_equal @period.to_s
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rack-attack
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.0
4
+ version: 4.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aaron Suggs
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-28 00:00:00.000000000 Z
11
+ date: 2014-05-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack