]> cat aescling's git repositories - mastodon.git/commitdiff
Mark the 410 gone response for suspended accounts as cachable (#10339)
authorThibG <thib@sitedethib.com>
Thu, 21 Mar 2019 22:33:18 +0000 (23:33 +0100)
committerEugen Rochko <eugen@zeonfederated.com>
Thu, 21 Mar 2019 22:33:18 +0000 (23:33 +0100)
This will help a great deal with #9377 when a caching reverse proxy is
configured.

app/controllers/concerns/account_controller_concern.rb

index 8817fd7de4616dce601f89d2138c07a35f74c256..4f28941ae9cc8187a1f454c9a388c22fe252764d 100644 (file)
@@ -69,6 +69,10 @@ module AccountControllerConcern
   end
 
   def check_account_suspension
-    gone if @account.suspended?
+    if @account.suspended?
+      skip_session!
+      expires_in(3.minutes, public: true)
+      gone
+    end
   end
 end