From 67d550830b3b1a9a2b65b1ab98ea4bcd491666c5 Mon Sep 17 00:00:00 2001
From: Eugen Rochko <eugen@zeonfederated.com>
Date: Tue, 22 Mar 2022 12:29:04 +0100
Subject: [PATCH] Fix locale not being set in REST API (#17847)

---
 app/controllers/activitypub/base_controller.rb | 1 +
 app/controllers/api/base_controller.rb         | 2 --
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/app/controllers/activitypub/base_controller.rb b/app/controllers/activitypub/base_controller.rb
index 4cbc3ab8f2..196d85a326 100644
--- a/app/controllers/activitypub/base_controller.rb
+++ b/app/controllers/activitypub/base_controller.rb
@@ -2,6 +2,7 @@
 
 class ActivityPub::BaseController < Api::BaseController
   skip_before_action :require_authenticated_user!
+  skip_around_action :set_locale
 
   private
 
diff --git a/app/controllers/api/base_controller.rb b/app/controllers/api/base_controller.rb
index 72c30dec73..d96285b440 100644
--- a/app/controllers/api/base_controller.rb
+++ b/app/controllers/api/base_controller.rb
@@ -15,8 +15,6 @@ 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
-- 
GitLab