Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gravatar: disable default avatar #66

Closed
jpuffer opened this issue Jan 23, 2020 · 5 comments
Closed

Gravatar: disable default avatar #66

jpuffer opened this issue Jan 23, 2020 · 5 comments

Comments

@jpuffer
Copy link

jpuffer commented Jan 23, 2020

Unavatar's fallback does not work for email, because bad email addresses trigger Gravatar's fallback and get Gravatar's default image. For example, see the result of https://unavatar.now.sh/myuser@domain.com - it is Gravatar's fallback image, not Unavatar's fallback.
image

@Kikobeats
Copy link
Member

The problem is Gravatar is using a default image by default:
https://github.com/Kikobeats/unavatar/blob/master/src/providers/index.js#L17

I didn't find a way to disable this behavior. Any idea?

@Kikobeats Kikobeats changed the title Fallback image does not work for email addresses Gravatar: disable default avatar Jan 23, 2020
@Kikobeats
Copy link
Member

Duplicate of #64

@Kikobeats Kikobeats marked this as a duplicate of #64 Jan 23, 2020
@jpuffer
Copy link
Author

jpuffer commented Jan 23, 2020

Hi @Kikobeats! First, awesome library.... really impressive work. Thanks for replying to this! I believe the behavior I pointed out is actually fixable by Unavatar.

See the following:
https://unavatar.now.sh/user@domain.com?fallback=https://domain.com/myimage.jpg&json
returns {"url":"https://gravatar.com/avatar/cd2bfcffe5fee4a1149d101994d0987f?size=400&d="} but Gravatar gives the option of passing through the default image (urlencoded) into the d= parameter (see https://en.gravatar.com/site/implement/images#default-image). The above request should instead return {"url":"https://gravatar.com/avatar/cd2bfcffe5fee4a1149d101994d0987f?size=400&d=https%3A%2F%2Fdomain.com%2Fmyimage.jpg"}

If a user does not provide a fallback parameter to unavatar, then it should create the gravatar url with d=404 so unavatar can use its own fallback. Currently, it does not set the d value (see https://unavatar.now.sh/user@domain.com?json) which returns {"url":"https://gravatar.com/avatar/cd2bfcffe5fee4a1149d101994d0987f?size=400&d="} but should instead return {"url":"https://gravatar.com/avatar/cd2bfcffe5fee4a1149d101994d0987f?size=400&d=404"}

@Kikobeats Kikobeats reopened this Jan 23, 2020
@Kikobeats
Copy link
Member

Oh thanks for this reply, I wanted to change the gravatar behavior for a long time!

Can you make a PR? 🙂

@jpuffer
Copy link
Author

jpuffer commented Jan 23, 2020

Sure! #68

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants