mirror of
https://github.com/lunaisnotaboy/mastodon.git
synced 2024-12-22 13:17:13 +00:00
Avoid return within block (#17590)
This prevents the error: LocalJumpError (unexpected return)
This commit is contained in:
parent
1de2e3f980
commit
f9e7f2e409
|
@ -82,10 +82,14 @@ class Rack::Attack
|
|||
end
|
||||
|
||||
throttle('throttle_sign_up_attempts/ip', limit: 25, period: 5.minutes) do |req|
|
||||
return unless req.post? && req.path == '/auth'
|
||||
return req.remote_ip.mask(64) if req.remote_ip.ipv6?
|
||||
if req.post? && req.path == '/auth'
|
||||
if req.remote_ip.ipv6?
|
||||
req.remote_ip.mask(64)
|
||||
else
|
||||
req.remote_ip
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
throttle('throttle_password_resets/ip', limit: 25, period: 5.minutes) do |req|
|
||||
req.remote_ip if req.post? && req.path == '/auth/password'
|
||||
|
|
Loading…
Reference in a new issue