Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cross Origin Resource Sharing Headers not working only for safari

I'm using rackspace to host my image files that are drawn on an html5 canvas object. Because of an HTML security feature when saving a canvas I have to use CORS (Cross Origin Resource Headers) to make save work.

I have tested my code on Chrome, IE with Chrome Frame, and Firefox, and none of them give me a security error after I added to the image request headers:

Access-Control-Allow-Origin: * 

and I have added the following attribute to all the images drawn on to the canvas

crossOrigin = "anonymous"

However, for some reason Safari still gives a security error.

SECURITY_ERR: DOM Exception 18: An attempt was made to break through the security policy of the user agent.

Any thoughts as to why this is happening on safari(desktop 5.1.7, and ipad) versions? I have checked the documentation and everything I have read says that Safari 4+ supports CORS?

like image 824
John Avatar asked Nov 03 '22 23:11

John


1 Answers

Safari 5.2 in beta solves the problem. So it looks like Safari does not yet support cors for images in released versions. The same goes for iOS safari

like image 101
John Avatar answered Nov 09 '22 07:11

John