about summary refs log tree commit diff
path: root/app/controllers/concerns/rate_limit_headers.rb
diff options
context:
space:
mode:
authorDavid Yip <yipdw@member.fsf.org>2017-12-12 02:54:13 -0600
committerDavid Yip <yipdw@member.fsf.org>2017-12-12 02:54:13 -0600
commita057ed5cfea2c1c4fb21984cadae993740fb25e0 (patch)
treec965f135b8c46f679eb22e80a37550c8b985b9ea /app/controllers/concerns/rate_limit_headers.rb
parent04eaa1943f002865f8a0234e19c6ea4cc1d3bb6a (diff)
parent14c4a33cd9bfc1212cb362897272e5ea7d1529e5 (diff)
Merge remote-tracking branch 'tootsuite/master' into merge-upstream
Diffstat (limited to 'app/controllers/concerns/rate_limit_headers.rb')
-rw-r--r--app/controllers/concerns/rate_limit_headers.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/app/controllers/concerns/rate_limit_headers.rb b/app/controllers/concerns/rate_limit_headers.rb
index 36cb91075..b79c558d8 100644
--- a/app/controllers/concerns/rate_limit_headers.rb
+++ b/app/controllers/concerns/rate_limit_headers.rb
@@ -44,7 +44,8 @@ module RateLimitHeaders
   end
 
   def api_throttle_data
-    request.env['rack.attack.throttle_data']['api']
+    most_limited_type, = request.env['rack.attack.throttle_data'].min_by { |_, v| v[:limit] }
+    request.env['rack.attack.throttle_data'][most_limited_type]
   end
 
   def request_time