comparison mod_http_avatar/mod_http_avatar.lua @ 5720:0f103a6e9ba4

mod_http_avatar: Fix displaying the fallback on Firefox
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Thu, 16 Nov 2023 16:25:52 +0100
parents 5b4e7db5943c
children
comparison
equal deleted inserted replaced
5719:18bae78282a6 5720:0f103a6e9ba4
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);