mirror of
https://github.com/samsonjs/rack-attack.git
synced 2026-04-27 15:07:41 +00:00
Make throttling_spec work when running it with rails 4.2
This commit is contained in:
parent
08b2cc4d95
commit
0ff1b5be83
1 changed files with 2 additions and 2 deletions
|
|
@ -36,7 +36,7 @@ describe "#throttle" do
|
||||||
# Could be used to have different rate limits for authorized
|
# Could be used to have different rate limits for authorized
|
||||||
# vs general requests
|
# vs general requests
|
||||||
limit_proc = lambda do |request|
|
limit_proc = lambda do |request|
|
||||||
if request.get_header("X-APIKey") == "private-secret"
|
if request.env["X-APIKey"] == "private-secret"
|
||||||
2
|
2
|
||||||
else
|
else
|
||||||
1
|
1
|
||||||
|
|
@ -67,7 +67,7 @@ describe "#throttle" do
|
||||||
# Could be used to have different rate limits for authorized
|
# Could be used to have different rate limits for authorized
|
||||||
# vs general requests
|
# vs general requests
|
||||||
period_proc = lambda do |request|
|
period_proc = lambda do |request|
|
||||||
if request.get_header("X-APIKey") == "private-secret"
|
if request.env["X-APIKey"] == "private-secret"
|
||||||
10
|
10
|
||||||
else
|
else
|
||||||
30
|
30
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue