From 16af283d28049a95e0fde5e101a79a8b29ae4955 Mon Sep 17 00:00:00 2001 From: Gonzalo Rodriguez Date: Wed, 31 Jan 2018 19:12:44 -0300 Subject: [PATCH] Don't make README examples depend on activesupport --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 66e2d6e..b5381e7 100644 --- a/README.md +++ b/README.md @@ -187,7 +187,7 @@ end # Throttle login attempts for a given email parameter to 6 reqs/minute # Return the email as a discriminator on POST /login requests -Rack::Attack.throttle('logins/email', limit: 6, period: 60.seconds) do |req| +Rack::Attack.throttle('logins/email', limit: 6, period: 60) do |req| req.params['email'] if req.path == '/login' && req.post? end @@ -209,7 +209,7 @@ Rack::Attack.track("special_agent") do |req| end # Supports optional limit and period, triggers the notification only when the limit is reached. -Rack::Attack.track("special_agent", limit: 6, period: 60.seconds) do |req| +Rack::Attack.track("special_agent", limit: 6, period: 60) do |req| req.user_agent == "SpecialAgent" end