A platform for community discussion. Free, open, simple.
FIX: Allow avatar downloads to follow redirects
Robin Ward8b4e71cb212f
diff --git a/plugins/discourse-narrative-bot/plugin.rb b/plugins/discourse-narrative-bot/plugin.rbindex 0c61b923b60..9b598a681f6 100644--- a/plugins/discourse-narrative-bot/plugin.rb+++ b/plugins/discourse-narrative-bot/plugin.rb@@ -108,7 +108,7 @@ after_initialize dodef 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).readrescue OpenURI::HTTPError# Ignore if fetching image returns a non 200 responseend