From 1f3677684d2ae78c08c304437df2bd3c2e58edce Mon Sep 17 00:00:00 2001 From: John Livingston Date: Mon, 12 Feb 2024 17:20:21 +0100 Subject: [PATCH] Fix new avatars content-type. --- CHANGELOG.md | 6 ++++++ .../mod_random_vcard_peertubelivechat.lua | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e94f8266..5dc5393a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## 8.2.1 + +### Minor changes and fixes + +* Fix new avatars content-type. + ## 8.2.0 ### New features diff --git a/prosody-modules/mod_random_vcard_peertubelivechat/mod_random_vcard_peertubelivechat.lua b/prosody-modules/mod_random_vcard_peertubelivechat/mod_random_vcard_peertubelivechat.lua index 43aefbda..8f420072 100644 --- a/prosody-modules/mod_random_vcard_peertubelivechat/mod_random_vcard_peertubelivechat.lua +++ b/prosody-modules/mod_random_vcard_peertubelivechat/mod_random_vcard_peertubelivechat.lua @@ -10,8 +10,9 @@ local avatars_files = assert(module:get_option_array("peertubelivechat_random_vc local avatars = {}; local function load_avatar(filename) local file = assert(io.open(path.join(avatars_dir, filename), "r")); + local filetype = filename.sub(filename, -3); -- jpg or png local result = { - type = 'image/jpg', + type = 'image/' .. filetype, content = b64(file:read("*a")) }; file:close();