Skip to content

Commit bccb719

Browse files
ClearlyClaireGargron
authored andcommitted
Avoid redundant HTTP request on some error cases (mastodon#10115)
1 parent a2acb2e commit bccb719

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

app/helpers/jsonld_helper.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ def fetch_resource_without_id_validation(uri, on_behalf_of = nil)
6868
return body_to_json(response.body_with_limit) if response.code == 200
6969
end
7070
# If request failed, retry without doing it on behalf of a user
71+
return if on_behalf_of.nil?
7172
build_request(uri).perform do |response|
7273
response.code == 200 ? body_to_json(response.body_with_limit) : nil
7374
end

0 commit comments

Comments
 (0)