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

[avatar] Fix CORS for uiAvatar resolution #67

Closed
vnphanquang opened this issue Nov 8, 2022 · 1 comment
Closed

[avatar] Fix CORS for uiAvatar resolution #67

vnphanquang opened this issue Nov 8, 2022 · 1 comment
Assignees
Labels
scope:avatar @svelte-put/avatar type:bug
Milestone

Comments

@vnphanquang
Copy link
Owner

vnphanquang commented Nov 8, 2022

fetch to uiAvatar failed with CORS, perhaps consider using picture tag for better native support and also much clearer interface / priority specification?

But if using picture tag, consider passing trials to slot for easy user customization?

@vnphanquang vnphanquang self-assigned this Nov 8, 2022
@vnphanquang vnphanquang added this to the Docs Site milestone Nov 8, 2022
@vnphanquang
Copy link
Owner Author

picture will not solve problem (as it does not pass to next source if resource is 404).

Root cause for cors error is ui-avatar endpoint does not allow cors if format is svg

Solution is to rely on image onerror and update src exhaustively.

Most helpful resource: https://stackoverflow.com/questions/52231187/handling-multiple-image-fallbacks-in-javascript

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope:avatar @svelte-put/avatar type:bug
Projects
Archived in project
Development

No branches or pull requests

1 participant