gpt4 book ai didi

google-cloud-platform - 设置 CORS 配置时出现 Google Storage ArgumentException

转载 作者:行者123 更新时间:2023-12-02 19:53:53 25 4
gpt4 key购买 nike

按照 Google 文档,使用 GoogleCloud Storage 控制台时:

mysef@myproject:~$ cat cors-json-file.json 
[
{
"origin": ["*"],
"method": ["GET"],
"maxAgeSeconds": 3600
}
]

然后我收到以下错误:

myself@myproject:~$ gsutil cors set cors-json-file.json gs://mybucket
Setting CORS on gs://mybucket/...
ArgumentException: JSON CORS data could not be loaded from: [
{
"origin": ["*"],
"method": ["GET"],
"maxAgeSeconds": 3600
}
]

当我删除“method”、“maxAgeSeconds”或添加“responseHeader”时出现同样的错误。

最佳答案

经过多次尝试,我最终将 json 文件修改为:

$ cat cors-json-file.json 
[{
"origin": ["*"],
"method": ["GET"],
"maxAgeSeconds": 3600
}]

而且......它成功了!请注意,Google 文档中的示例是我的第一个案例([{ 共 2 行)

关于google-cloud-platform - 设置 CORS 配置时出现 Google Storage ArgumentException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38618666/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com