diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2018-07-28 23:14:55 +0200 |
---|---|---|
committer | nightpool <eg1290@gmail.com> | 2018-07-28 17:14:55 -0400 |
commit | cc94b1d95a7baba4435010ca4e5d7f3425140275 (patch) | |
tree | 95c8540d833c2a5dc226395823a6fdc8528f5182 /app/services/activitypub/fetch_remote_account_service.rb | |
parent | 2ccef52a4f5be49e5c3b2256a3c5d4f193a3fe32 (diff) |
Prevent ActivityPub movedTo recursion (#8092)
Fix #8051
Diffstat (limited to 'app/services/activitypub/fetch_remote_account_service.rb')
-rw-r--r-- | app/services/activitypub/fetch_remote_account_service.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/services/activitypub/fetch_remote_account_service.rb b/app/services/activitypub/fetch_remote_account_service.rb index 867e70876..41fec9170 100644 --- a/app/services/activitypub/fetch_remote_account_service.rb +++ b/app/services/activitypub/fetch_remote_account_service.rb @@ -7,14 +7,14 @@ class ActivityPub::FetchRemoteAccountService < BaseService # Should be called when uri has already been checked for locality # Does a WebFinger roundtrip on each call - def call(uri, id: true, prefetched_body: nil) + def call(uri, id: true, prefetched_body: nil, break_on_redirect: false) @json = if prefetched_body.nil? fetch_resource(uri, id) else body_to_json(prefetched_body) end - return unless supported_context? && expected_type? + return if !supported_context? || !expected_type? || (break_on_redirect && @json['movedTo'].present?) @uri = @json['id'] @username = @json['preferredUsername'] |