FIX: Allow avatar downloads to follow redirects

This commit is contained in:
Robin Ward 2019-10-24 14:01:54 -04:00
parent 2c0efac25e
commit 8b4e71cb21
1 changed files with 1 additions and 1 deletions

View File

@ -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