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

Fetch avatars without CORS #168

Merged
merged 1 commit into from
May 14, 2024
Merged

Fetch avatars without CORS #168

merged 1 commit into from
May 14, 2024

Conversation

robintown
Copy link
Member

By omitting the crossOrigin attribute, we change avatars to use a non-CORS request to fetch the image. This allows avatars to load even on null origins (fixing element-hq/element-web#26491), but also prevents us from inspecting the image data in JavaScript, for example by using it in a canvas. We weren't doing that of course, so switching to the locked-down non-CORS mode should have no consequences.

Closes element-hq/compound#293

By omitting the crossOrigin attribute, we change avatars to use a non-CORS request to fetch the image. This allows avatars to load even on null origins (fixing element-hq/element-web#26491), but also prevents us from inspecting the image data in JavaScript, for example by using it in a canvas. We weren't doing that of course, so switching to the locked-down non-CORS mode should have no consequences.
@robintown robintown requested a review from a team as a code owner May 14, 2024 18:12
@robintown robintown requested review from dbkr and t3chguy and removed request for a team May 14, 2024 18:12
Copy link

Deploying compound-web with  Cloudflare Pages  Cloudflare Pages

Latest commit: 5f0b5bd
Status: ✅  Deploy successful!
Preview URL: https://7dd01ab5.compound-web.pages.dev
Branch Preview URL: https://avatar-no-cors.compound-web.pages.dev

View logs

@t3chguy
Copy link
Member

t3chguy commented May 14, 2024

thanks

@robintown robintown merged commit c2adb37 into main May 14, 2024
6 checks passed
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

Successfully merging this pull request may close these issues.

Avatar forces crossOrigin=anonymous which is not always appropriate
2 participants