Skip to content

Commit

Permalink
Fix ActivityPub and REST API queries setting cookies and preventing c…
Browse files Browse the repository at this point in the history
…aching (mastodon#11539)

Regression from mastodon#8657
  • Loading branch information
ClearlyClaire authored and multiple creatures committed Feb 21, 2020
1 parent 892b9a8 commit 49ad6d3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/controllers/accounts_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ class AccountsController < ApplicationController
before_action :set_cache_headers
before_action :set_body_classes

skip_around_action :set_locale, if: -> { request.format == :json }

def show
respond_to do |format|
format.html do
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/api/base_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ class Api::BaseController < ApplicationController

protect_from_forgery with: :null_session

skip_around_action :set_locale

rescue_from ActiveRecord::RecordInvalid, Mastodon::ValidationError do |e|
render json: { error: e.to_s }, status: 422
end
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/statuses_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ class StatusesController < ApplicationController
before_action :set_body_classes
before_action :set_autoplay, only: :embed

skip_around_action :set_locale, if: -> { request.format == :json }

content_security_policy only: :embed do |p|
p.frame_ancestors(false)
end
Expand Down

0 comments on commit 49ad6d3

Please sign in to comment.