1
I am accessing image files on one server from code in my website on another server, so CORS is required. The images are placed on a canvas, and I use canvas.toDataURL() to obtain the resulting URL, so the access must no be tainted. I have tried both 'Header set Access-Control-Allow-Origin "*"' and 'Header set Access-Control-Allow-Origin "https://my-website.com"' (at different times) in the .htaccess file in /public_html on the image server.
Problem: Some of the image files are accessed just fine, but others get the following error: 'from origin 'example1.com' has been blocked by CORS policy: The 'Access-Control-Allow-Origin' header has a value 'example2.com' that is not equal to the supplied origin.'
What reason could there be that some files are accessed fine and other files in the same directory are blocked?