lib/rack/throttle/limiter.rb in railslove-rack-throttle-0.0.0 vs lib/rack/throttle/limiter.rb in railslove-rack-throttle-0.0.1

- old
+ new

@@ -33,11 +33,11 @@ def call(env) request = Rack::Request.new(env) if allowed?(request) app.call(env) else - call_on_reject + call_on_reject(env) rate_limit_exceeded end end ## @@ -87,11 +87,11 @@ end protected # Calls whatever object is passed with options[:on_reject] on initialize - def call_on_reject - @options[:on_reject].call if @options[:on_reject] + def call_on_reject(env) + @options[:on_reject].call(env) if @options[:on_reject] end ## # @return [Hash] def cache