File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,8 @@ if (project.data.website && project.data.status !== "dead") {
2929 const iconHref = website (" link[rel='icon'], link[rel='shortcut icon']" )[0 ]
3030 ?.attribs .href ;
3131 if (iconHref ) {
32- iconSrc = new URL (iconHref , project .data .website ).toString ();
32+ const faviconRes = await fetch (new URL (iconHref , project .data .website ));
33+ iconSrc = ` data:${faviconRes .headers .get (" content-type" )};base64,${Buffer .from (await faviconRes .arrayBuffer ()).toString (" base64" )} ` ;
3334 } else {
3435 const faviconRes = await fetch (
3536 ` ${new URL (project .data .website ).origin }/favicon.ico ` ,
@@ -38,7 +39,7 @@ if (project.data.website && project.data.status !== "dead") {
3839 faviconRes .ok &&
3940 ! faviconRes .headers .get (" content-type" )?.startsWith (" text/" )
4041 ) {
41- iconSrc = faviconRes .url ;
42+ iconSrc = ` data:${ faviconRes .headers . get ( " content-type " )};base64,${ Buffer . from ( await faviconRes . arrayBuffer ()). toString ( " base64 " )} ` ;
4243 }
4344 }
4445 }
You can’t perform that action at this time.
0 commit comments