Skip to content

Commit 71a63ad

Browse files
committed
Merge branch 'main' into jm-random-period-offset
Conflicts: lib/rack/attack/cache.rb Resolved (just a code comment)
2 parents d925ef7 + 95ce9fd commit 71a63ad

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

lib/rack/attack/cache.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def key_and_expiry(unprefixed_key, period, use_offset = false)
6969
period_number, time_into_period = period_number_and_time_into(period, offset)
7070
period_remainder = period - time_into_period
7171
@last_retry_after_time = @last_epoch_time + period_remainder
72-
# Add 1 to expires_in to avoid timing error: https://git.io/i1PHXA
72+
# Add 1 to expires_in to avoid timing error: https://github.com/rack/rack-attack/pull/85
7373
expires_in = period_remainder + 1
7474
["#{prefix}:#{period_number}:#{unprefixed_key}", expires_in]
7575
end

lib/rack/attack/path_normalizer.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ module Rack
44
class Attack
55
# When using Rack::Attack with a Rails app, developers expect the request path
66
# to be normalized. In particular, trailing slashes are stripped.
7-
# (See https://git.io/v0rrR for implementation.)
7+
# (See
8+
# https://github.com/rails/rails/blob/f8edd20/actionpack/lib/action_dispatch/journey/router/utils.rb#L5-L22
9+
# for implementation.)
810
#
911
# Look for an ActionDispatch utility class that Rails folks would expect
1012
# to normalize request paths. If unavailable, use a fallback class that

0 commit comments

Comments
 (0)