grape-throttle 0.0.4 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a48ae0d355926dc09eb0e43731cf314a8aba10da
4
- data.tar.gz: dbfa8774da7394b93e90306cc7b7dc0fc3f88dd1
3
+ metadata.gz: c2bc3d66275c45b179d7f9c3692f738601d74dc6
4
+ data.tar.gz: bf2fc95a5c5025123580883ec8183af7c16ef022
5
5
  SHA512:
6
- metadata.gz: c8c98f8c8270a9b4ef1c5b07686183081063d3a3aab2152803b72e53d0c4e5aa1771ad2bbda257eec72b50da8c712ce900ad198cc3880a71e30aadf28b304d2a
7
- data.tar.gz: ea2c3665786c6f8b1d21bf65de5de6c527be26bb581591d6b8c17c294c622ddd06f6c66a9174ccef66c65f88d1cdbd2b1450c2af93fcfadec843a9c927898abc
6
+ metadata.gz: 18eda6a157f6f812af9382963093379db528e51b6fe6c00f059b806e39a2d7cd746c40529cc498edaeb5186ec5553817867b6ee7eac37716be49505fb8e80f32
7
+ data.tar.gz: d262d85427da186ca16c6ff2cc236b3b005549b38478f506dfcd8e2624743fb5e8e19edfe6e7533d7b4e4cf59a6c9b81ecac3d807c7b520c4196c9cc86c021ae
@@ -33,7 +33,7 @@ module Grape
33
33
  redis.ping
34
34
  current = redis.get(rate_key).to_i
35
35
  if !current.nil? && current >= limit
36
- endpoint.error!("too many requests, please try again later", 403)
36
+ endpoint.error!("too many requests, please try again later", 429)
37
37
  else
38
38
  redis.multi do
39
39
  # Set the value of the key to COUNTER_START if the key does not already exist and
@@ -43,7 +43,7 @@ describe "ThrottleHelper" do
43
43
 
44
44
  it "is throttled beyond the rate limit" do
45
45
  4.times { get "/throttle" }
46
- expect(last_response.status).to eq(403)
46
+ expect(last_response.status).to eq(429)
47
47
  end
48
48
 
49
49
  describe "with custom period" do
@@ -55,7 +55,7 @@ describe "ThrottleHelper" do
55
55
 
56
56
  it "is throttled beyond the rate limit" do
57
57
  4.times { get "/throttle-custom-period" }
58
- expect(last_response.status).to eq(403)
58
+ expect(last_response.status).to eq(429)
59
59
  end
60
60
 
61
61
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: grape-throttle
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alejandro Wainzinger
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-02 00:00:00.000000000 Z
11
+ date: 2015-12-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack-test