mirror of
https://github.com/discourse/discourse.git
synced 2024-12-14 21:34:23 +08:00
FIX: Allow avatar downloads to follow redirects
This commit is contained in:
parent
c38c37bcc3
commit
069d358c80
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user