Rejected because no crossdomain.xml policy file was found

Posted TPMer

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Rejected because no crossdomain.xml policy file was found相关的知识,希望对你有一定的参考价值。

Unity加载Web资源需求crossdomain.xml文件格式


当使用WWW访问Web服务时,安全策略会阻止跨域的请求访问,会返回类似“Rejected because no crossdomain.xml policy file was found”等错误信息。
解决办法:为提供Web服务的目录配置安全策略文件,即crossdomain.xml,crossdomain.xml文件的写法如下:


<?xml version="1.0" encoding="ISO-8859-1"?>
<cross-domain-policy>
<allow-access-from domain="*"/>
</cross-domain-policy>


domain=“*” 表示该服务目录允许任何外域来访问,你也可以把“*”替换成指定的域名,如下:

<allow-access-from domain=”*.taobao.com”/>

<allow-access-from domain="*" to-ports="1200-1220"/>开放的端口


crossdomain.xml起初是adobe搞的,为了让flash跨域访问文件。

该配置文件放于服务器端的根目录下面。来设置让哪些域名下面的swf文件能够访问我服务器上的内容。

注意: crossdomain.xml必须是一个ASCII文件。
该文件要放置在服务器的根目录下,例如:www.xy.net/crossdomain.xmlhttp://ip:port/crossdomain.xml

本地调试程序时解决跨域问题的方法:
菜单设置:Edit->Project Settings->Eidtor


以上是关于Rejected because no crossdomain.xml policy file was found的主要内容,如果未能解决你的问题,请参考以下文章

Ajax使用formdata异步上传文件,报错the request was rejected because no multipart boundary was found

vue中使用axios简单封装用法,axios报错the request was rejected because no multipart boundar

Updates were rejected because the remote contains work that you do

Updates were rejected because the tip of your current branch is behind

SpringBoot 提示:RequestRejectedException:The request was rejected because the URL was not normalized.

VS2019 github push失败: Updates were rejected because the tip of your current branch is behind