Module: Rack

Defined in:
lib/rack/attack/request.rb,
lib/rack/attack.rb,
lib/rack/attack/cache.rb,
lib/rack/attack/check.rb,
lib/rack/attack/track.rb,
lib/rack/attack/railtie.rb,
lib/rack/attack/version.rb,
lib/rack/attack/fail2ban.rb,
lib/rack/attack/safelist.rb,
lib/rack/attack/throttle.rb,
lib/rack/attack/allow2ban.rb,
lib/rack/attack/blocklist.rb,
lib/rack/attack/base_proxy.rb,
lib/rack/attack/configuration.rb,
lib/rack/attack/path_normalizer.rb,
lib/rack/attack/store_proxy/dalli_proxy.rb,
lib/rack/attack/store_proxy/redis_proxy.rb,
lib/rack/attack/store_proxy/redis_store_proxy.rb,
lib/rack/attack/store_proxy/mem_cache_store_proxy.rb,
lib/rack/attack/store_proxy/redis_cache_store_proxy.rb,
lib/rack/attack/store_proxy/active_support_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.safelist("localhost") {|req| req.localhost? }

Defined Under Namespace

Classes: Attack