我的 Flash/Flex 应用程序出现问题。几个月来,它可以从 Twilio 下载文件,但现在我收到以下错误:
(我必须删除超链接,所以想象“ttp”实际上是“http”。:)
SecurityErrorEvent type="securityError" bubbles=false cancelable=false eventPhase=2 text="Error #2048: Security sandbox violation: ttp://localhost/myapp.swf?v=1 cannot load data from ttp://api.twilio.com/."
我在 Flash 插件上启用了策略日志记录并收到以下消息:
OK: Searching for in policy files to authorize data loading from resource at ttp://api.twilio.com/ by requestor from ttp://localhost/myapp.swf?v=1 Warning: [strict] Policy file requested from ttp://api.twilio.com/crossdomain.xml redirected to ttps://api.twilio.com/crossdomain.xml; will use final URL in determining scope. Warning: Domain api.twilio.com does not specify a meta-policy. Applying default meta-policy 'master-only'. This configuration is deprecated. See ttp://www.adobe.com/go/strict_policy_files to fix this problem. OK: Policy file accepted: ttps://api.twilio.com/crossdomain.xml Error: Request for resource at ttp://api.twilio.com by requestor from ttp://localhost/myapp.swf?v=1 is denied due to lack of policy file permissions.
所以在我看来,问题在于 Twilio 没有指定“元策略”。我有办法解决这个问题吗?
最佳答案
localhost
和 twilio.com
不在同一域中,因此您当然会收到安全错误。 Twilio 需要将此节点添加到跨域中:
<site-control permitted-cross-domain-policies="all"/>
此外,请确保您的嵌入符合标准:
allowscriptaccess = "always"
allownetworking = "all"
如果 Twilio 不会更新 crossdomain.xml,那么您可以在托管 Flex 应用程序的服务器上安装代理,并通过代理获取数据。
关于闪存安全错误 #2048 : Is there a workaround or does Twilio have to change their meta-policy?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5435495/