CodeFatherG / probi-oh

https://codefatherg.github.io/probi-oh/
GNU General Public License v3.0
0 stars 1 forks source link

CORS error when trying to use card image data on UI #49

Closed CodeFatherG closed 4 weeks ago

CodeFatherG commented 1 month ago

Error given when trying to access card image data. The API query for the url is fine, but then the download and cache fails

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://localhost:3001/proxy-image?url=https%3A%2F%2Fimages.ygoprodeck.com%2Fimages%2Fcards%2F49721904.jpg. (Reason: CORS request did not succeed). Status code: (null).
Error fetching image: TypeError: NetworkError when attempting to fetch resource. card-api.ts:216:16
CodeFatherG commented 4 weeks ago

I have built a scraper that hosts the images at

https://github.com/CodeFatherG/yugioh-db

If you use raw links then the cors is avoided. https://raw.githubusercontent.com/CodeFatherG/yugioh-db/master/cards/11714098/images/cropped.jpg