GAE java服务器无法激活Access-Control-Allow-Origin

时间:2012-09-21 15:53:54

标签: google-app-engine webserver

我正在尝试将服务器设置为允许跨域脚本,以访问由appengine提供的资产:“static.myapp.org”

我将此配置添加到我的appengine-web.xml,如https://developers.google.com/appengine/docs/java/config/appconfig

中的解释
   <static-files>
      <include path="/**.txt" >
        <http-header name="Access-Control-Allow-Origin" value="http://myapp.org" />
      </include>
    </static-files>

设置此配置后,我在尝试上传时收到了下一个错误:

Bad configuration: XML error validating /war/WEB-INF/appengine-web.xml against /opt/appengine-java-sdk-1.6.6/docs/appengine-web.xsd
  Caused by: cvc-complex-type.2.2: Element 'include' must have no element [children], and the value must be valid.

有什么想法吗?

1 个答案:

答案 0 :(得分:0)

静态内容上的HTTP标头为introduced in GAE SDK 1.7.0。你好像在使用1.6.6。