gpt4 book ai didi

python - 如何在 Google App Engine Python 服务器上启用 CORS?

转载 作者:太空狗 更新时间:2023-10-29 22:15:38 25 4
gpt4 key购买 nike

我在 Javascript 控制台上看到以下错误:

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.

如何使用 Google App Engine (Python) 启用跨源资源共享以访问?

最佳答案

您必须在您的 yaml 配置中使用 Access-Control-Allow-Origin http header

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

docs 中的 CORS 支持下查找更多信息

关于python - 如何在 Google App Engine Python 服务器上启用 CORS?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31212992/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com