cross-origin not working I get “Anonymous caller does not have storage.objects.get access to”

本秂侑毒 提交于 2019-12-11 08:46:56

问题


In a bucket you can change cross policy https://cloud.google.com/storage/docs/cross-origin I followed this steps:

In gsutil: First I removed the read permisions from allUsers that I configured at first

gsutil iam ch -d allUsers gs:/myBucketName

I removed it because even if I configured the json to serve only on localhost:8080, it serves content from other ports. Then I configure with gsutil as pointed out here https://cloud.google.com/storage/docs/configuring-cors this json options:

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

In gsutil:

 gsutil cors set cor.json gs://myBucketName

After that, I´m using a simple html and a local server that only have this content:

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

But I when my broser try to fetch the image, It gets and xml that says:"Anonymous caller does not have storage.objects.get

any idea what could be wrong?

来源:https://stackoverflow.com/questions/50124777/cross-origin-not-working-i-get-anonymous-caller-does-not-have-storage-objects-g

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!