mirror of
https://github.com/mastodon/mastodon.git
synced 2025-11-27 10:00:50 +00:00
apply changes from #34610
This commit is contained in:
parent
e4dabf1c99
commit
b887626f9c
|
|
@ -289,20 +289,7 @@ module JsonLdHelper
|
||||||
return collection_or_uri if collection_or_uri.is_a?(Hash)
|
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)
|
return if !reference_uri.nil? && non_matching_uri_hosts?(reference_uri, collection_or_uri)
|
||||||
|
|
||||||
# NOTE: For backward compatibility reasons, Mastodon signs outgoing
|
fetch_resource_without_id_validation(collection_or_uri, on_behalf_of, raise_on_error: :temporary)
|
||||||
# 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
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def valid_activitypub_content_type?(response)
|
def valid_activitypub_content_type?(response)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user