Reputation:
I'm trying to allow all origins using the following command:
gsutil cors set /tmp/cors.json gs://my_bucket
Would the proper json document be:
[
{
"origin": ["*"]
}
]
Or:
[
{
"origin": "*"
}
]
Upvotes: 13
Views: 11282
Reputation: 281
As reference,
printf '[{"origin": ["*"],"responseHeader": ["*"],"method":
["GET","POST","HEAD"],"maxAgeSeconds": 86400}]' > cors.json
gsutil cors set cors.json gs://<bucket_name>
Upvotes: 27
Reputation: 88398
It should be "origin": ["*"]
.
The origin
value is expected to be an array, even if you only want to specify a single origin or only the *
wildcard. See, e.g., the example at https://cloud.google.com/storage/docs/gsutil/commands/cors#description.
Upvotes: 9