I know there are tons of questions regarding CORS policy in HTML5 tag.
All of them are talking about the server side settings that you need to change the access headers in the server settings or put the headers yourself in the php file etc.
But i am loading images using Loader
class and i don't have access to that server.
how do i change the :
Access-Control-Allow-Origin
to *
i tried pushing the headers with the URL Request :
urlRequest.requestHeaders.push( new URLRequestHeader( 'Access-Control-Allow-Origin', '*' ) );
but no matter what i did :
i get this error :
Complete code snippet:
loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onImageLoadComplete);
var request:URLRequest = new URLRequest();
request.url = "http://www.someserver.com/some_image.jpg";
request.contentType = "image/jpeg"; //tried it didn't make a difference
request.requestHeaders.push( new URLRequestHeader( 'Access-Control-Allow-Origin', '*' ) );
loader.load(request);