Skip to content

Commit

Permalink
refactor: minor refactoring (#635)
Browse files Browse the repository at this point in the history
  • Loading branch information
santib authored Oct 28, 2023
1 parent 4a68deb commit ffc2102
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 ffc2102

Please sign in to comment.