cross-origin not working我得到“匿名调用者没有storage.objects.get访问权限”

时间:2018-05-01 22:35:05

标签: google-app-engine cross-domain google-cloud-storage

在存储桶中,您可以更改交叉策略https://cloud.google.com/storage/docs/cross-origin 我按照这个步骤:

在gsutil中: 首先,我删除了我在第一次配置的所有用户的读取权限

gsutil iam ch -d allUsers gs:/myBucketName

我删除了它,因为即使我将json配置为仅在localhost:8080上提供服务,它也会提供来自其他端口的内容。 然后我按照这里指出的那样配置gsutil https://cloud.google.com/storage/docs/configuring-cors 这个json选项:

[{ "origin":["http://localhost:8080"],
"responseHeader":["Content-Type"],
"method":["GET"],
"maxAgeSeconds":0
}]

在gsutil中:

 gsutil cors set cor.json gs://myBucketName

之后,我使用的是一个简单的html和只有这个内容的本地服务器:

<html>
<body>
<img src="linkfrombyObject">
</body>
</html>

但是当我的broser尝试获取图像时,它获取和xml说:“匿名调用者没有storage.objects.get enter image description here

enter image description here 什么可能是错的? comand line

0 个答案:

没有答案
相关问题