本文介绍了如何在Google App Engine Python服务器上启用CORS?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 你的yaml配置中的http header  

 处理程序:
- url:/
...
http_headers:
Access-Control-Allow-Origin:http:// my-url

在中的CORS支持中查找更多信息


I am see the following error on Javascript console:

VM31:1 XMLHttpRequest cannot load '<some-url>'. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin '<my-url>' is therefore not allowed access.

How do I enable Cross-Origin Resource Sharing with Google App Engine (Python) to access ?

解决方案

You'll have to use the Access-Control-Allow-Origin http header in your yaml configuration

handlers:
- url: /
  ...
  http_headers:
    Access-Control-Allow-Origin: http://my-url

Find more under CORS Support in the docs

这篇关于如何在Google App Engine Python服务器上启用CORS?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-01 21:00