diff options
author | ThibG <thib@sitedethib.com> | 2020-02-19 22:31:53 +0100 |
---|---|---|
committer | multiple creatures <dev@multiple-creature.party> | 2020-02-21 02:41:07 -0600 |
commit | 33751e4d35863bbe2af96c5aa2f674bb407f528d (patch) | |
tree | 16404549be4ada0aa3b61226c281c8077970fc17 | |
parent | e59d8fb46c2417cdeb9fe254bfdf12e23a3660b0 (diff) |
Fix account JSON/RSS not being cacheable due to wrong mime type comparison (#13116)
`request.format` is not a symbol but a `Mime::Type`, so the condition actually never matched, and a session was created even for those requests, preventing caching.
-rw-r--r-- | app/controllers/accounts_controller.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/controllers/accounts_controller.rb b/app/controllers/accounts_controller.rb index f8b0066a4..e4770b824 100644 --- a/app/controllers/accounts_controller.rb +++ b/app/controllers/accounts_controller.rb @@ -9,7 +9,7 @@ class AccountsController < ApplicationController before_action :set_cache_headers before_action :set_body_classes - skip_around_action :set_locale, if: -> { [:json, :rss].include?(request.format) } + skip_around_action :set_locale, if: -> { [:json, :rss].include?(request.format&.to_sym) } skip_before_action :require_functional! def show |