DEV: Be sure to read the file into string before base64

Follow up to: 08b4753843

If you don't use `read` base64 will error out with: "no implicit
conversion of Tempfile into String"
This commit is contained in:
Blake Erickson 2019-11-14 05:55:36 -07:00
parent 08b4753843
commit fe01099a38
1 changed files with 1 additions and 1 deletions

View File

@ -114,7 +114,7 @@ after_initialize do
max_file_size: SiteSetting.max_image_size_kb.kilobytes,
tmp_file_name: 'narrative-bot-avatar',
follow_redirect: true
)
).read
rescue OpenURI::HTTPError
# Ignore if fetching image returns a non 200 response
end