about summary refs log tree commit diff
path: root/app/services
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/services
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/services')
-rw-r--r--app/services/follow_remote_account_service.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/app/services/follow_remote_account_service.rb b/app/services/follow_remote_account_service.rb
index 43d3698e9..0a95badb2 100644
--- a/app/services/follow_remote_account_service.rb
+++ b/app/services/follow_remote_account_service.rb
@@ -23,6 +23,8 @@ class FollowRemoteAccountService < BaseService
 
     data = Goldfinger.finger("acct:#{uri}")
 
+    raise Goldfinger::Error, 'Missing resource links' if data.link('http://schemas.google.com/g/2010#updates-from').nil? || data.link('salmon').nil? || data.link('http://webfinger.net/rel/profile-page').nil? || data.link('magic-public-key').nil?
+
     account.remote_url  = data.link('http://schemas.google.com/g/2010#updates-from').href
     account.salmon_url  = data.link('salmon').href
     account.url         = data.link('http://webfinger.net/rel/profile-page').href