From 3b395629540c05c2a6585ef5bcf0cac435be7bc5 Mon Sep 17 00:00:00 2001 From: Shlee Date: Fri, 10 Apr 2026 23:44:09 +0930 Subject: [PATCH] Minor: Moved the debug log to the correct location. (#38639) --- app/services/activitypub/fetch_remote_actor_service.rb | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app/services/activitypub/fetch_remote_actor_service.rb b/app/services/activitypub/fetch_remote_actor_service.rb index 9daa7e445e..f5f00ef120 100644 --- a/app/services/activitypub/fetch_remote_actor_service.rb +++ b/app/services/activitypub/fetch_remote_actor_service.rb @@ -33,14 +33,12 @@ class ActivityPub::FetchRemoteActorService < BaseService # FEP-2c59 defines a `webfinger` attribute that makes things more explicit and spares an extra request in some cases. # It supersedes `preferredUsername`. - if @json['webfinger'].present? && @json['webfinger'].is_a?(String) - @username, @domain = split_acct(@json['webfinger']) - Rails.logger.debug { "Actor #{uri} has an invalid `webfinger` value, falling back to `preferredUsername`" } - end + @username, @domain = split_acct(@json['webfinger']) if @json['webfinger'].present? && @json['webfinger'].is_a?(String) if @username.blank? || @domain.blank? raise "Actor #{uri} has no `preferredUsername`, and either a bogus or missing `webfinger`, which is a requirement for Mastodon compatibility" if @json['preferredUsername'].blank? + Rails.logger.debug { "Actor #{uri} has an invalid `webfinger` value, falling back to `preferredUsername`" } if @json['webfinger'].present? @username = @json['preferredUsername'] @domain = Addressable::URI.parse(@uri).normalized_host end