闪存和跨域问题 [英] flash and cross domain problem

查看:123
本文介绍了闪存和跨域问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在运行一个rails3项目与外部资产主机所有的javascript,图像,swfs等。这是一个完全不同的域。所以知道我试图嵌入一些SWF使用swfobject。在开发(同一主机)一切工作正常,但在生产(不同的主机),它不启动闪光(firebug显示文件加载,但没有出现在页面上)。我已经把这个crossdomain.xml文件放在资产主机的根目录下了,但根本没有改变。

I'm running a rails3 project with an external asset host for all javascript, images, swfs etc. This is on a completely different domain. So know I tried to embed some SWFs using swfobject. In development (same host) everything works fine, but in production (different hosts) it doesn't start the flash (firebug shows the file is loaded but nothing appears on the page). I already put this crossdomain.xml file in the root of the asset host but it does not change anything at all.

http://my.host/crossdomain.xml

<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM "http://www.adobe.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
  <allow-access-from domain="*" />
</cross-domain-policy>

http://my.host/swfs/sound1.swf
http://my.host/swfs/video1.swf
...

http://my.host/swfs/sound1.swf http://my.host/swfs/video1.swf ...

我能做些什么来使它工作?我使用的SWF不是由我开发的,所以我不能改变它们。有些是简单的声音,有些是视频和小的应用程序。

What can I do to make it work? The SWFs I'm using are not developed by me, so I cannot change them. Some are simple sounds, others are videos and small "apps". I don't want to have to make rails serve the swfs.

推荐答案

您的内容主机需要允许从您的资产主机,而不是相反。

Your "content" host needs to allow access from your "asset" host, not the other way around.

这是为了保护用户免受跨站点脚本,所以让拥有文件的主机决定他们是否可以访问将是向后。

This is to protect users from cross site scripting, so having the host that holds the files decide whether or not they can have access would be all backwards.

这篇关于闪存和跨域问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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