ambassify / react-avatar

Universal avatar makes it possible to fetch/generate an avatar based on the information you have about that user.
MIT License
643 stars 118 forks source link

Gravatar gives 404 #251

Open pointlevel opened 2 years ago

pointlevel commented 2 years ago

Hi,

When i use this component and check the network-tab in dev-tools, a created request to https://secure.gravatar.com/avatar/1f9d9a9efcf523b09629444632b5c?d=404&s=60 gives a 404.

JorgenEvens commented 2 years ago

This happens when you supply an e-mailaddress to the Avatar component. It will automatically attempt to find an Avatar for that user using the Gravatar service. If non exists Gravatar will return a 404.

This 404 is cached in localStorage, so it should not occur every time the same avatar is loaded. If you find the cache not aggressive enough you can check out how to configure the cache or build your own here: https://github.com/ambassify/react-avatar/tree/9e9c0a0d4a5f14b93933087e00fa84c101f16a0b#cache

Alternatively you can supply the sources you would like to support to your component as discussed here: https://github.com/ambassify/react-avatar/tree/9e9c0a0d4a5f14b93933087e00fa84c101f16a0b#transpiled-es5-javascript--commonjs