about summary refs log tree commit diff
path: root/app/controllers/api/v1/follows_controller.rb
diff options
context:
space:
mode:
authorEugen <eugen@zeonfederated.com>2017-04-04 14:51:42 +0200
committerGitHub <noreply@github.com>2017-04-04 14:51:42 +0200
commit48dfdad49255ae4a100e01f41852e65806858fce (patch)
treea2bfe7a94bcd7a37399470b31c0453e1b489dea9 /app/controllers/api/v1/follows_controller.rb
parent5b6f4fdeb4932df1704da01762cc22c63aacb20f (diff)
parented4a723a82e90fc057494e4fdec4a2074a3164c7 (diff)
Merge branch 'master' into patch-1
Diffstat (limited to 'app/controllers/api/v1/follows_controller.rb')
-rw-r--r--app/controllers/api/v1/follows_controller.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/app/controllers/api/v1/follows_controller.rb b/app/controllers/api/v1/follows_controller.rb
index c22dacbaa..7c0f44f03 100644
--- a/app/controllers/api/v1/follows_controller.rb
+++ b/app/controllers/api/v1/follows_controller.rb
@@ -7,7 +7,7 @@ class Api::V1::FollowsController < ApiController
   respond_to :json
 
   def create
-    raise ActiveRecord::RecordNotFound if params[:uri].blank?
+    raise ActiveRecord::RecordNotFound if follow_params[:uri].blank?
 
     @account = FollowService.new.call(current_user.account, target_uri).try(:target_account)
     render action: :show
@@ -16,6 +16,10 @@ class Api::V1::FollowsController < ApiController
   private
 
   def target_uri
-    params[:uri].strip.gsub(/\A@/, '')
+    follow_params[:uri].strip.gsub(/\A@/, '')
+  end
+
+  def follow_params
+    params.permit(:uri)
   end
 end