如何在Python Google App Engine Sdk中配置flex crossdomain.xml

发布于 2024-10-17 05:45:11 字数 734 浏览 1 评论 0 原文

我在Python Gae sdk中创建了一个flex应用程序,但收到错误2048,因此我在static文件夹下放置了一个crossdomain.xml。 crossdomain.xml 如下:

<?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 中添加以下内容:

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

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

请指教。谢谢。

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> 

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

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

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.

Please advice. Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

予囚 2024-10-24 05:45:11

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

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

如果 Flash 非常挑剔,您可能需要指定 mimetype(text/xml 或 application/xml)。

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

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

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

<?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>

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.

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

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

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

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>
会傲 2024-10-24 05:45:11

FlashPlayer 正在 URL 域根中查找 crossdomain.xml 文件,例如

domain.com/crossdomain.xml

FlashPlayer 想要找到它的位置。

但是,您可以使用 Security.loadPolicyFile(url) 从服务器上的备用位置加载 crossdomain.xml 文件。

有关 Adob​​e livedocs 的更多信息

FlashPlayer is looking for the crossdomain.xml file in the URL domain root, e.g.

domain.com/crossdomain.xml

Is where the FlashPlayer wants to find it.

However, you can use Security.loadPolicyFile(url) to load a crossdomain.xml file from an alternate location on the server.

More info on Adobe livedocs

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文