[Basilisk] Don't try to force x-icon image type for search engine icon.

If it's not actually an image, then throw a warning in the console and bail.
This commit is contained in:
Moonchild 2021-03-24 09:58:48 +00:00 committed by roytam1
commit d88f98c226

View file

@ -1371,8 +1371,12 @@ Engine.prototype = {
}
let type = chan.contentType;
if (!type.startsWith("image/"))
type = "image/x-icon";
if (!type.startsWith("image/")) {
console.warn(
"Search service: Unable to set icon, content type is not an image",
contentType);
return;
}
let dataURL = "data:" + type + ";base64," +
btoa(String.fromCharCode.apply(null, aByteArray));