From e5e83ebaeddfe1c99b7c556b722cd1eaa41b8df7 Mon Sep 17 00:00:00 2001 From: sneakers-the-rat Date: Mon, 5 May 2025 13:39:49 -0700 Subject: [PATCH] apply changes from #34610 --- app/helpers/json_ld_helper.rb | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/app/helpers/json_ld_helper.rb b/app/helpers/json_ld_helper.rb index f53167e152..8543d321e4 100644 --- a/app/helpers/json_ld_helper.rb +++ b/app/helpers/json_ld_helper.rb @@ -278,20 +278,7 @@ module JsonLdHelper return collection_or_uri if collection_or_uri.is_a?(Hash) return if !reference_uri.nil? && non_matching_uri_hosts?(reference_uri, collection_or_uri) - # NOTE: For backward compatibility reasons, Mastodon signs outgoing - # queries incorrectly by default. - # - # While this is relevant for all URLs with query strings, this is - # the only code path where this happens in practice. - # - # Therefore, retry with correct signatures if this fails. - begin - fetch_resource_without_id_validation(collection_or_uri, on_behalf_of, raise_on_error: :temporary) - rescue Mastodon::UnexpectedResponseError => e - raise unless e.response && e.response.code == 401 && Addressable::URI.parse(collection_or_uri).query.present? - - fetch_resource_without_id_validation(collection_or_uri, on_behalf_of, raise_on_error: :temporary, request_options: { omit_query_string: false }) - end + fetch_resource_without_id_validation(collection_or_uri, on_behalf_of, raise_on_error: :temporary) end def valid_activitypub_content_type?(response)