【发布时间】:2017-08-22 18:21:36
【问题描述】:
我有许多基于 GAE for Python 的应用程序和一个基于 AngularJS 的应用程序。其他的工作正常,AngularJS 的工作正常。现在我收到以下错误:
XMLHttpRequest 无法加载 xxxxxxxxx/rest/loadlocale?locale=en。 从 'xxxxxxxxxxxxxxx/rest/loadlocale?locale=en' 重定向到 'https://www.google.com/accounts/ServiceLogin?service=ah&passive=true&...... 已被 CORS 策略阻止:没有“访问控制允许来源” 请求的资源上存在标头。原点 'xxxxxxxx' 是 因此不允许访问。
如果我从 Chrome 显式转到 ServiceLogin,该应用程序将在一段时间内正常运行。过了一会儿(我假设登录过期)错误再次出现。
app.yaml 有以下部分:
- url: /rest/.*
script: main.APP
login: required
secure: always
但删除“secure: always”没有区别。
错误发生在第一个客户端 http 请求时,但请求处理程序的 Python 服务器代码没有显示任何迹象 访问。
【问题讨论】:
标签: angularjs google-app-engine cors