如何重置(删除)存储设置的存储桶? (GCP)
我写了 CORS设置 “ cors.json”文件,如下所示。
“ cors.json” :
[
{
"origin": ["http://localhost:8000"],
"method": ["GET"],
"responseHeader": ["Content-Type"],
"maxAgeSeconds": 3600
}
]
然后,将下面的命令运行 cors设置 我的水桶如下所示:
gsutil cors set cors.json gs://my-bucket
现在,我该怎么能重置(删除) CORS设置?
I wrote the CORS settings to "cors.json" file as shown below.
"cors.json":
[
{
"origin": ["http://localhost:8000"],
"method": ["GET"],
"responseHeader": ["Content-Type"],
"maxAgeSeconds": 3600
}
]
Then, run the command below to set the CORS settings to my bucket as shown below:
gsutil cors set cors.json gs://my-bucket
Now, how can I reset(delete) the CORS settings?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您需要仅将“ []”写入 “ cors.json”文件如下所示:
“ cors.json” :
然后,运行下面的命令再次重置(删除)您的存储桶的CORS设置如下所示:
最后,如果运行下面的命令:
您将在下面获取此消息:
另外,对于“ gsutil cors” ,只有“ set” 和“ get” 如下所示:
因此,对于 “ gsutil cors” ,没有“重置” 和“ delete” ,如下所示:
You need to write only "[]" to "cors.json" file as shown below:
"cors.json":
Then, run the command below again to reset(delete) the CORS settings of your bucket as shown below:
Finally, if running the command below:
You will get this message below:
In addition, for "gsutil cors", there are only "set" and "get" as shown below:
So, for "gsutil cors", there are no "reset" and "delete" as shown below:
截至2022年,有一个命令可以清除水桶上的CORS配置。
https://cloud.google.com/storage/storage/configuring-confore-configuring-confore-configuring-contorage-configuring-ecor- cors#disable-示例
As of 2022, there is a command to clear the CORS configuration on a bucket.
https://cloud.google.com/storage/docs/configuring-cors#disable-example