docs: fix Basic Auth example typo

This commit is contained in:
Gonzalo Rodriguez 2019-03-28 12:08:48 -03:00
parent ca95156acc
commit 306d157df3
No known key found for this signature in database
GPG key ID: 5DB8B81B049B8AB1

View file

@ -85,7 +85,7 @@ An example implementation for blocking hackers who spam basic auth attempts. See
# block all requests from that IP for 1 hour.
Rack::Attack.blocklist('basic auth crackers') do |req|
Rack::Attack::Allow2Ban.filter(req.ip, :maxretry => 5, :findtime => 1.minute, :bantime => 1.hour) do
# Return true if the authorization header not incorrect
# Return true if the authorization header is incorrect
auth = Rack::Auth::Basic::Request.new(req.env)
auth.credentials != [my_username, my_password]
end