Skip to content

Commit

Permalink
Fix account JSON/RSS not being cacheable due to wrong mime type compa…
Browse files Browse the repository at this point in the history
…rison (mastodon#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.
  • Loading branch information
ClearlyClaire authored and multiple creatures committed Feb 21, 2020
1 parent e59d8fb commit 33751e4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/controllers/accounts_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 33751e4

Please sign in to comment.