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

Fix CORS issue when trying to convert images to base64 #103

Open
alexanderadam opened this issue Jan 21, 2022 · 0 comments
Open

Fix CORS issue when trying to convert images to base64 #103

alexanderadam opened this issue Jan 21, 2022 · 0 comments

Comments

@alexanderadam
Copy link

alexanderadam commented Jan 21, 2022

Hi 0x6b,

I hope you're fine.

Actual Result

I tried to copy something and it failed due to a CORS rule when trying to fetch images.

I guess the safest variant would be to read the already loaded images from the DOM (and also faster).

Otherwise APIs to fetch data can often decide whether they go with or without CORS.
Is the referring domain is always localhost or something like that?
Anyway, most libraries and native APIs can set something like the no-cors property and disable the check in this case.

Otherwise it might be possible to set the Referer HTTP header to the current domain in these requests.

Expected Result

No CORS errors. 😉

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

1 participant