Skip to content

Commit

Permalink
Minor refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
santib committed Oct 27, 2023
1 parent 4a68deb commit e937a82
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/rack/attack/throttle.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,9 @@ def matched_by?(request)
epoch_time: cache.last_epoch_time
}

annotate_request_with_throttle_data(request, data)

(count > current_limit).tap do |throttled|
annotate_request_with_throttle_data(request, data)
if throttled
annotate_request_with_matched_data(request, data)
Rack::Attack.instrument(request)
Expand Down

0 comments on commit e937a82

Please sign in to comment.