Module: Rack
- Defined in:
- lib/rack/attack/request.rb,
lib/rack/attack/cache.rb,
lib/rack/attack/check.rb,
lib/rack/attack/track.rb,
lib/rack/attack/version.rb,
lib/rack/attack/fail2ban.rb,
lib/rack/attack/throttle.rb,
lib/rack/attack/allow2ban.rb,
lib/rack/attack/blacklist.rb,
lib/rack/attack/whitelist.rb,
lib/rack/attack/store_proxy.rb,
lib/rack/attack/conditional_throttle.rb,
lib/rack/attack/store_proxy/dalli_proxy.rb,
lib/rack/attack/store_proxy/redis_store_proxy.rb
Overview
Rack::Attack::Request is the same as ::Rack::Request by default.
This is a safe place to add custom helper methods to the request object through monkey patching:
class Rack::Attack::Request < ::Rack::Request
def localhost?
ip == "127.0.0.1"
end
end
Rack::Attack.whitelist("localhost") {|req| req.localhost? }
Defined Under Namespace
Classes: Attack