Fix new avatars content-type.
This commit is contained in:
parent
8a400d2d9f
commit
1f3677684d
@ -1,5 +1,11 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## 8.2.1
|
||||||
|
|
||||||
|
### Minor changes and fixes
|
||||||
|
|
||||||
|
* Fix new avatars content-type.
|
||||||
|
|
||||||
## 8.2.0
|
## 8.2.0
|
||||||
|
|
||||||
### New features
|
### New features
|
||||||
|
@ -10,8 +10,9 @@ local avatars_files = assert(module:get_option_array("peertubelivechat_random_vc
|
|||||||
local avatars = {};
|
local avatars = {};
|
||||||
local function load_avatar(filename)
|
local function load_avatar(filename)
|
||||||
local file = assert(io.open(path.join(avatars_dir, filename), "r"));
|
local file = assert(io.open(path.join(avatars_dir, filename), "r"));
|
||||||
|
local filetype = filename.sub(filename, -3); -- jpg or png
|
||||||
local result = {
|
local result = {
|
||||||
type = 'image/jpg',
|
type = 'image/' .. filetype,
|
||||||
content = b64(file:read("*a"))
|
content = b64(file:read("*a"))
|
||||||
};
|
};
|
||||||
file:close();
|
file:close();
|
||||||
|
Loading…
Reference in New Issue
Block a user