Fetch favicons "fast".
Inspired by 11ty's IndieWeb Avatar service, but with the sole improvement of returning a fallback icon if nothing is found.
Icons are searched for in the following order:
link[rel="apple-touch-icon"]
link[rel="apple-touch-icon-precomposed"]
link[rel~="icon"]
link[rel="mask-icon"]
- The website origin's
/favicon.ico
The first valid match will be returned, sized down to 64x64 if necessary.
Because cloud hosting is expensive, and I like having money, I've set up CORS on
my deployment to only allow my website to use it (you can probably circumvent it,
but please don't). Self-hosting this should be easy enough if you just change the
constants in the rust file, and optionally provide a different fallback.svg
.
This software is licensed under Version 3 of the GNU Affero General Public License, or at your option, any later version.