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

CORS settings #54

Closed
donbraffitt opened this issue Oct 18, 2018 · 2 comments
Closed

CORS settings #54

donbraffitt opened this issue Oct 18, 2018 · 2 comments

Comments

@donbraffitt
Copy link

Hi,

I was trying to load a card image in JavaScript, but I think the CORS headers on your web server do not allow this.

Here are 2 .png files I tried:

https://raw.githubusercontent.com/petercpark/Mindless-Rubik-s-Cube-Solution/master/rubikscube.png
https://deckofcardsapi.com/static/img/KH.png

The 1st loads fine from JavaScript, but the 2nd fails when I try to load it from JavaScript. Here is the URL I used to test CORS headers for these 2 .png files:

https://www.test-cors.org/

I just pasted each URL into the Remote URL box. The JavaScript framework I am using is p5.js, but I don't think the framework is the source of this particular problem since the CORS headers test fine for the rubikscube.png file and that file loads fine in p5.js, but the KH.png file fails the CORS headers test and will not load in p5.js using loadImage.

Don Braffitt

@donbraffitt
Copy link
Author

Yes. I can now load the card images from p5.js using loadImage(). Thanks!

Don

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