From 8b4e71cb212fbe34f9613b5b17f6cfb2016a959f Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Thu, 24 Oct 2019 14:01:54 -0400 Subject: [PATCH] FIX: Allow avatar downloads to follow redirects --- plugins/discourse-narrative-bot/plugin.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/discourse-narrative-bot/plugin.rb b/plugins/discourse-narrative-bot/plugin.rb index 0c61b923b6..9b598a681f 100644 --- a/plugins/discourse-narrative-bot/plugin.rb +++ b/plugins/discourse-narrative-bot/plugin.rb @@ -108,7 +108,7 @@ after_initialize do def fetch_avatar_url(user) avatar_url = UrlHelper.absolute(Discourse.base_uri + user.avatar_template.gsub('{size}', '250')) - URI(avatar_url).open('rb', redirect: false).read + URI(avatar_url).open('rb', redirect: true, allow_redirections: :all).read rescue OpenURI::HTTPError # Ignore if fetching image returns a non 200 response end