cors - 仅设置 CORS Google Cloud Storage 存储桶
问题描述
我在我的存储桶上设置了 CORS 策略以允许来自我的云功能的请求,
gsutil cors get gs://my-project.appspot.com
返回:
[{"maxAgeSeconds": 3600,
"method": ["GET"],
"origin": ["https://us-central1-my-project.cloudfunctions.net"],
"responseHeader": ["Content-Type"]}]
但是,当我尝试从我的云功能访问资源时,我收到以下错误:
从源“ https://us-central1-my-project.cloudfunctions.net ”访问“ https://storage.cloud.google.com/my-project.appspot.com/mydata.csv ”的 XMLHttpRequest被 CORS 策略阻止:请求的资源上不存在“Access-Control-Allow-Origin”标头。
我不知道从这里去哪里。我怎样才能解决这个问题?
解决方案
推荐阅读
- ios - 如何最好地在 Swift 中存储地图/数组数据以在 Firestore 中使用
- python - 我可以在 python 函数的参数中强制执行 lambda 吗?
- javascript - 阻止或侦听用户在开发人员工具中删除事件侦听器?
- ios - Swift TableViewCell 客户 didSelect
- apache-spark - pyspark 加快写入 S3
- javascript - 移动设备上的 Safari 浏览器后退按钮,不会将用户返回到上一页的最后滚动位置
- java - 提供者信息的 Keycloak 服务器信息页面
- reactjs - 上下文不适用时的下一个最佳选择
- c# - C#试图输出一个字符数组但顺序相反
- docker - 禁用来自图像的缓存