about summary refs log tree commit diff
diff options
context:
space:
mode:
authorClaire <claire.github-309c@sitedethib.com>2022-09-24 07:41:01 +0200
committerGitHub <noreply@github.com>2022-09-24 07:41:01 +0200
commit85890bc80fe622744f838b8f1ebdfa9278cb3d2b (patch)
tree26fd450f11998083673bec05f893db15be39aa85
parent0c99c6c3df7882e4a5f6df5ad17e2823211158c0 (diff)
Fix crash in FetchRemoteKeyService (#19225)
Fix regression from #19212
-rw-r--r--app/services/activitypub/fetch_remote_key_service.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/app/services/activitypub/fetch_remote_key_service.rb b/app/services/activitypub/fetch_remote_key_service.rb
index fe8f60b55..32e82b47a 100644
--- a/app/services/activitypub/fetch_remote_key_service.rb
+++ b/app/services/activitypub/fetch_remote_key_service.rb
@@ -12,7 +12,7 @@ class ActivityPub::FetchRemoteKeyService < BaseService
     if prefetched_body.nil?
       if id
         @json = fetch_resource_without_id_validation(uri)
-        if person?
+        if actor_type?
           @json = fetch_resource(@json['id'], true)
         elsif uri != @json['id']
           raise Error, "Fetched URI #{uri} has wrong id #{@json['id']}"
@@ -27,7 +27,7 @@ class ActivityPub::FetchRemoteKeyService < BaseService
     raise Error, "Unable to fetch key JSON at #{uri}" if @json.nil?
     raise Error, "Unsupported JSON-LD context for document #{uri}" unless supported_context?(@json)
     raise Error, "Unexpected object type for key #{uri}" unless expected_type?
-    return find_actor(@json['id'], @json, suppress_errors) if person?
+    return find_actor(@json['id'], @json, suppress_errors) if actor_type?
 
     @owner = fetch_resource(owner_uri, true)
 
@@ -51,10 +51,10 @@ class ActivityPub::FetchRemoteKeyService < BaseService
   end
 
   def expected_type?
-    actor? || public_key?
+    actor_type? || public_key?
   end
 
-  def actor?
+  def actor_type?
     equals_or_includes_any?(@json['type'], ActivityPub::FetchRemoteActorService::SUPPORTED_TYPES)
   end