From fe01099a38f791124130d0adc35f755fb0d5a11b Mon Sep 17 00:00:00 2001 From: Blake Erickson Date: Thu, 14 Nov 2019 05:55:36 -0700 Subject: [PATCH] DEV: Be sure to read the file into string before base64 Follow up to: 08b4753843917d62a2d4480052e1d590fdc45315 If you don't use `read` base64 will error out with: "no implicit conversion of Tempfile into String" --- 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 e3e6afea78a..31949915f4b 100644 --- a/plugins/discourse-narrative-bot/plugin.rb +++ b/plugins/discourse-narrative-bot/plugin.rb @@ -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