diff options
author | ThibG <thib@sitedethib.com> | 2020-02-19 22:31:53 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-19 22:31:53 +0100 |
commit | d8e9bae482b2921c3a06e6d94c0b8a07cf0c41ff (patch) | |
tree | 2a36318574c8c3cc6d45c0130e420ec1ae6abba6 | |
parent | 1314bba68a5f2d271312bad08f108e1ff56c2c00 (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 0a8015a56..124393d62 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 |