Cross-domain 策略文件详解

所属分类: 网页制作 / Flash 阅读数: 700
收藏 0 赞 0 分享
crossdomain.xml最通常放置的地方是一个domain的root文件夹,flash player会默认检测这个路径下的crossdomain.xml文件,这个root目录下的crossdomain.xml叫做master policy file,大家记住这个概念,下面会用到。

crossdomain.xml的Schema就是那个http://www.adobe.com/xml/dtds/cross-domain-policy.dtd,详细规定了crossdomain.xml每个节点的属性选项,大家可以自己去浏览。

crossdomain.xml的根节点必须是cross-domain-policy:

它包含三个子节点:site-control, allow-access-from, allow-http-request-headers-from
无属性
节点介绍:

site-control
这个节点定义当前域的meta-policy
meta-policy决定这个域中除了master policy file以外哪些策略文件可以被client接受
如果这个策略文件并不是master policy file,site-control这个节点就会被忽略。
如果你用ActionScript指定使用某个非master policy file的策略文件,你必须先检查master policy file的这个子节点以确认你指定的那个policy file是被授权的。
site-control的属性permitted-cross-domian-policies有5个选项:none--任何policy file都不被允许,包括master policy file。master-only不用解释了。by-content-type--当HTTP头的Content-Type值为text/x-cross-domain-policy才被允许。by-ftp-filename--只有以文件名结尾的URL才被允许。all--不用介绍。默认值是master-only,除了socket policy file,它的默认值是all。


allow-access-from


allow-http-request-headers-from
===============================================

Adobe 强烈不推荐的允许所有资源访问的crossdomain.xml文件范例:

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

<cross-domain-policy>
<site-control permitted-cross-domain-policies="all"/>
<allow-access-from domain="*" secure="false"/>
<allow-http-request-headers-from domain="*" headers="*" secure="false"/>
</cross-domain-policy>
更多精彩内容其他人还在看

js与flash的交互FLASH连播控制器

js与flash的交互FLASH连播控制器
收藏 0 赞 0 分享

Flash CS3组件开发图文教程

Flash CS3组件开发图文教程
收藏 0 赞 0 分享

flash as Actionscript中的数组的使用方法

flash as Actionscript中的数组的使用方法
收藏 0 赞 0 分享

用flash as脚本 控制 Flash中文本框样式的代码

用flash as脚本 控制 Flash中文本框样式的代码
收藏 0 赞 0 分享

209个透明flash背景以及使用方法详解

我们平时做站的时候偶尔会用到一些比较炫的透明flash去修饰页面,但如果你自己并没有那么高深的flash技术可以随意创造心中所想的效果时,那么这些flash透明和背景或许能帮到你,其中有一些是很漂亮的!
收藏 0 赞 0 分享

比较漂亮的几款可爱的flash日历收藏

比较漂亮的几款可爱的flash日历收藏
收藏 0 赞 0 分享

Flash 与 html 的一些实用技巧

Flash 与 html 的一些实用技巧
收藏 0 赞 0 分享

全flash站制作剖析

全flash站制作剖析
收藏 0 赞 0 分享

flash加载各种外部文件

flash加载各种外部文件
收藏 0 赞 0 分享

收藏了98个flash片头

收藏了98个flash片头
收藏 0 赞 0 分享
查看更多