Whenever I want to render an image, I keep getting CORS related errors:
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at ...jpg. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing). Status code: 200.
I set the ‘src’ property like this:
this.Image.patch({ src: image.url });
When using the Fetch API with mode set to ‘no-cors’, I’m able to fetch the image:
fetch(image.url, { mode: "no-cors" })...
Is there a way to set a CORS property on the Image texture?
header, but instead it uses the Set-Cookie HTTP response header.
AFAIK, the HTMLImageElement in a regular HTML/JavaScript application automatically sends the cookie HTTP request header (and possibly no-cors mode) when setting the src property.
For example, this is what I see in the developer tools:
For future reference, just using an image as a WebGL texture requires same-origin or the CORS header. So the worker does not add additional restrictions.