Google 云存储不一致的响应
Google Cloud Storage inconsistent responses
我在 Google 云存储中设置了一个存储桶,"object default permissions" 设置为 "User" 组 "allUsers" 授予 "Reader" 权限。
存储桶中有许多文件,我有一个客户端通过尝试访问特定文件来检查它是否存在。大多数时候我们会收到 404 响应,但我们经常会在前几次尝试中看到 403 响应。
403 响应正文(使用我自己的格式和私人信息替换):
<?xml version='1.0' encoding='UTF-8'?>
<Error>
<Code>AccessDenied</Code>
<Message>Access denied.</Message>
<Details>Anonymous users does not have storage.objects.get access to object mybucket/myfile.gz.</Details>
</Error>
所以我的问题是,为什么我在尝试打开一个不存在的文件时有时会收到 403 响应,有时会收到 404 响应?
我知道从 2017 年 5 月 29 日起会有变化,但它们尚未生效,所以看来要么是出了什么问题,要么是 Google 提前随机应用了新逻辑。
我通过来自 Google 的电子邮件得到了关于此问题的明确答案,因此我给出了完整的回复。
It has been found out that there was a miscommunication between the Engineers. Originally, the changes were supposed to be scheduled on 5/22 but due to some internal delays, they decided to announce it on a later date which is 5/29. Due to this confusion, the Engineers rolled this feature out on the original date (5/22) instead of 5/29.
TL;DR:Google 搞砸了,提前一周推出了重大更改。
我在 Google 云存储中设置了一个存储桶,"object default permissions" 设置为 "User" 组 "allUsers" 授予 "Reader" 权限。
存储桶中有许多文件,我有一个客户端通过尝试访问特定文件来检查它是否存在。大多数时候我们会收到 404 响应,但我们经常会在前几次尝试中看到 403 响应。
403 响应正文(使用我自己的格式和私人信息替换):
<?xml version='1.0' encoding='UTF-8'?>
<Error>
<Code>AccessDenied</Code>
<Message>Access denied.</Message>
<Details>Anonymous users does not have storage.objects.get access to object mybucket/myfile.gz.</Details>
</Error>
所以我的问题是,为什么我在尝试打开一个不存在的文件时有时会收到 403 响应,有时会收到 404 响应?
我知道从 2017 年 5 月 29 日起会有变化,但它们尚未生效,所以看来要么是出了什么问题,要么是 Google 提前随机应用了新逻辑。
我通过来自 Google 的电子邮件得到了关于此问题的明确答案,因此我给出了完整的回复。
It has been found out that there was a miscommunication between the Engineers. Originally, the changes were supposed to be scheduled on 5/22 but due to some internal delays, they decided to announce it on a later date which is 5/29. Due to this confusion, the Engineers rolled this feature out on the original date (5/22) instead of 5/29.
TL;DR:Google 搞砸了,提前一周推出了重大更改。