about summary refs log tree commit diff
path: root/app/controllers
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2016-10-13 13:41:06 +0200
committerEugen Rochko <eugen@zeonfederated.com>2016-10-13 13:41:06 +0200
commit157f03f8bdbca1b34895099b38e5f2a1aeb1bd23 (patch)
tree4c403a9475f1731e85887823cbd124658aae8865 /app/controllers
parent36e7eeb6b9b2964f05b3b842ddc05bdd42ff62d1 (diff)
No-op for Salmons without body, fail fast if Webfinger does not contain
all required resource links (profile page, salmon, atom feed, magic key)
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/api/salmon_controller.rb10
1 files changed, 8 insertions, 2 deletions
diff --git a/app/controllers/api/salmon_controller.rb b/app/controllers/api/salmon_controller.rb
index 8bd653d7d..c0ba32ff2 100644
--- a/app/controllers/api/salmon_controller.rb
+++ b/app/controllers/api/salmon_controller.rb
@@ -3,8 +3,14 @@ class Api::SalmonController < ApiController
   respond_to :txt
 
   def update
-    ProcessInteractionService.new.call(request.body.read, @account)
-    head 201
+    body = request.body.read
+
+    if body.nil?
+      head 200
+    else
+      ProcessInteractionService.new.call(body, @account)
+      head 201
+    end
   end
 
   private