about summary refs log tree commit diff
path: root/app
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2018-04-30 09:12:36 +0200
committerGitHub <noreply@github.com>2018-04-30 09:12:36 +0200
commit54f34d3f2ab4dbe3a4b572d60af18a4b49358ec6 (patch)
tree5203b0570a208a65a0a07ed9c61d511a2009b3d5 /app
parentda61352fab2e59ba42caf59d4e2e33d62eebe060 (diff)
Return HTTP 410 for suspended accounts in GET /api/v1/accounts/:id (#7287)
Fix #7243
Diffstat (limited to 'app')
-rw-r--r--app/controllers/api/v1/accounts_controller.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/app/controllers/api/v1/accounts_controller.rb b/app/controllers/api/v1/accounts_controller.rb
index d64325944..b7133ca8e 100644
--- a/app/controllers/api/v1/accounts_controller.rb
+++ b/app/controllers/api/v1/accounts_controller.rb
@@ -5,6 +5,7 @@ class Api::V1::AccountsController < Api::BaseController
   before_action -> { doorkeeper_authorize! :follow }, only: [:follow, :unfollow, :block, :unblock, :mute, :unmute]
   before_action :require_user!, except: [:show]
   before_action :set_account
+  before_action :check_account_suspension, only: [:show]
 
   respond_to :json
 
@@ -54,4 +55,8 @@ class Api::V1::AccountsController < Api::BaseController
   def relationships(**options)
     AccountRelationshipsPresenter.new([@account.id], current_user.account_id, options)
   end
+
+  def check_account_suspension
+    gone if @account.suspended?
+  end
 end