]> cat aescling's git repositories - mastodon.git/commitdiff
Avoid redundant HTTP request on some error cases (#10115)
authorThibG <thib@sitedethib.com>
Mon, 25 Feb 2019 14:54:17 +0000 (15:54 +0100)
committerEugen Rochko <eugen@zeonfederated.com>
Mon, 25 Feb 2019 14:54:17 +0000 (15:54 +0100)
app/helpers/jsonld_helper.rb

index 5323972723ee324dd59f33a812235e6d7ce8c5c0..59e4ae685136d79a35315091e664a05a2dcaeae1 100644 (file)
@@ -68,6 +68,7 @@ module JsonLdHelper
       return body_to_json(response.body_with_limit) if response.code == 200
     end
     # If request failed, retry without doing it on behalf of a user
+    return if on_behalf_of.nil?
     build_request(uri).perform do |response|
       response.code == 200 ? body_to_json(response.body_with_limit) : nil
     end