问题描述
我有两个服务器(prod.example.com和img.example.com)
i got two servers (prod.example.com and img.example.com)
所以prod我使用画布
so on "prod" i process images from "img" using canvas
在FF和Chrome都是Ok
in FF and Chrome all is Ok
但在Safari中我得到这个 SECURITY_ERR: DOM异常18:尝试突破用户代理的安全策略。
but in Safari i got this SECURITY_ERR: DOM Exception 18: An attempt was made to break through the security policy of the user agent.
来自img的所有图像都具有 Access-Control-Allow-Origin:*
在标题中
all images from "img" has Access-Control-Allow-Origin:*
in headers
那么padla在哪里?
so where is padla?
推荐答案
getImageData
你可能调用会引发这个,如果你尝试从另一个主机访问。你不能绕过这个,唯一的办法是从img.example.com代理到prod.example.com
getImageData
which you probably call will raise this if you try to access the one host from the other. You cannot go around this, the only way around it would be to proxy from img.example.com to prod.example.com
这篇关于SECURITY_ERR:DOM异常18仅在Safari中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!