跨源资源共享标头不只工作的safari [英] Cross Origin Resource Sharing Headers not working only for safari

查看:216
本文介绍了跨源资源共享标头不只工作的safari的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用rackspace来托管在html5 canvas对象上绘制的图像文件。因为保存画布时的HTML安全功能,我必须使用CORS(跨源资源标题)来保存工作。



我已在 Chrome,IE with Chrome Frame和Firefox 上测试我的代码,但在我添加后,它们都不会给我带来安全错误到图片请求标题:

 访问控制允许原产地:* 



并且我已将以下属性添加到绘制到画布上的所有图片

  crossOrigin =anonymous

安全错误。

  SECURITY_ERR:DOM异常18:尝试突破用户代理的安全策略。 

有什么想法为什么这是发生在safari(桌面5.1.7和ipad)版本?我已经检查了文档,并且我已经阅读的一切说明Safari 4+支持CORS?

解决方案

Safari 5.2在beta解决问题。所以看起来Safari还不支持发布版本中的图像。 iOS 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?

解决方案

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

这篇关于跨源资源共享标头不只工作的safari的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆