如何在 Python Google App Engine Sdk 中配置 flex crossdomain.xml [英] How to configure the flex crossdomain.xml in Python Google App Engine Sdk

查看:21
本文介绍了如何在 Python Google App Engine Sdk 中配置 flex crossdomain.xml的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Python Gae sdk 中创建了一个 flex 应用程序,但出现错误 2048,所以我在静态文件夹下放置了一个 crossdomain.xml.crossdomain.xml 如下:

I have created a flex application in the Python Gae sdk and I got the error 2048, so I put a crossdomain.xml under the static folder. The crossdomain.xml is following:

<?xml version="1.0"?> 
<!DOCTYPE cross-domain-policy SYSTEM "/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy> 
<site-control permitted-cross-domain-policies="all"/> 
<allow-access-from domain="*" to-ports="*" secure="false"/> 
<allow-http-request-headers-from domain="*" headers="*" secure="false"/> 
</cross-domain-policy> 

而且,我在 app.yaml 中添加以下内容:

And, I add the following in the app.yaml:

- url: /crossdomain.xml 
  static_files: static/crossdomain.xml 
  upload: static/crossdomain.xml

但是,我仍然收到错误 2048.因此,我想知道在我的情况下需要配置或遗漏的任何内容以及如何修复错误.

However, I still got the error 2048. Therefore, I would like to know is anything I need to configure or miss in my case and how to fix the error.

请指教.谢谢.

推荐答案

我没有在 Flash 中使用 crossdomain.xml,但我在 Unity3d 中使用过.我已经让它工作了,你的东西看起来是正确的.

I haven't used crossdomain.xml with Flash, but I have with Unity3d. I've gotten it to work, and what you have looks correct.

您是否访问过 yoursite.com/crossdomain.xml 以确保它在浏览器中可见?

Have you visited yoursite.com/crossdomain.xml to make sure it's visible in a browser?

如果 Flash 真的很挑剔,你可能需要指定一个 mimetype(text/xml 或 application/xml)

If Flash is really picky you might need to specify a mimetype (text/xml or application/xml)

- url: /crossdomain.xml 
  mime_type: text/xml
  static_files: static/crossdomain.xml 
  upload: static/crossdomain.xml

您可能还想在验证器中检查 crossdomain.xml 以确保您没有遗漏/> 或类似的东西.

You also might want to check you crossdomain.xml in a validator to make sure you're not missing a /> or something like that.

此外,请查看 html5boilerplate 的 crossdomain.xml.他们限制最少的版本应该适用于任何网站:

Also, check out html5boilerplate's crossdomain.xml. Their least restrictive version should work on any site:

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


<!-- Read this: www.adobe.com/devnet/articles/crossdomain_policy_file_spec.html -->

<!-- Most restrictive policy: -->
<!--
    <site-control permitted-cross-domain-policies="none"/>
-->


<!-- Least restrictive policy: -->
    <site-control permitted-cross-domain-policies="all"/>
    <allow-access-from domain="*" to-ports="*" secure="false"/>
    <allow-http-request-headers-from domain="*" headers="*" secure="false"/>
<!--
  If you host a crossdomain.xml file with allow-access-from domain="*"      
  and don’t understand all of the points described here, you probably       
  have a nasty security vulnerability. ~ simon willison
-->

</cross-domain-policy>

这篇关于如何在 Python Google App Engine Sdk 中配置 flex crossdomain.xml的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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