From 19330468094a16459dd72cc146a920cda66464e7 Mon Sep 17 00:00:00 2001 From: Emi Matchu Date: Wed, 24 Jan 2024 03:26:52 -0800 Subject: [PATCH] Try to fix the pet load limiter This is hard to test directly, but this is my guess from what I'm reading in this? https://stackoverflow.com/a/32958124/107415 --- config/initializers/attack.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/initializers/attack.rb b/config/initializers/attack.rb index a9bbb5f3..eefcadc1 100644 --- a/config/initializers/attack.rb +++ b/config/initializers/attack.rb @@ -12,7 +12,7 @@ Rack::Attack.throttled_responder = lambda do |req| if req.path.end_with?('.json') [503, {}, [PETS_THROTTLE_MESSAGE]] else - flash = req.flash + flash = req.env['action_dispatch.request.flash_hash'] flash[:warning] = PETS_THROTTLE_MESSAGE [302, {"Location" => "/"}, [PETS_THROTTLE_MESSAGE]] end