Comparison

mod_http_avatar/mod_http_avatar.lua @ 5856:75dee6127829 draft

Merge upstream
author Trần H. Trung <xmpp:trần.h.trung@trung.fun>
date Tue, 06 Feb 2024 18:32:01 +0700
parent 5743:0f103a6e9ba4
comparison
equal deleted inserted replaced
5664:52db2da66680 5856:75dee6127829
27 photo_type = photo:get_child_text("TYPE", "vcard-temp"); 27 photo_type = photo:get_child_text("TYPE", "vcard-temp");
28 binval = photo:get_child_text("BINVAL", "vcard-temp"); 28 binval = photo:get_child_text("BINVAL", "vcard-temp");
29 end 29 end
30 end 30 end
31 if not photo_type or not binval then 31 if not photo_type or not binval then
32 response.status_code = 404; 32 -- FIXME: should be a 404, but Firefox won’t display it in that case…
33 --response.status_code = 404;
33 response.headers.content_type = "image/svg+xml"; 34 response.headers.content_type = "image/svg+xml";
34 return default_avatar; 35 return default_avatar;
35 end 36 end
36 local avatar = base64.decode(binval); 37 local avatar = base64.decode(binval);
37 local hash = sha1(avatar, true); 38 local hash = sha1(avatar, true);