LoginSignup
20
13

More than 5 years have passed since last update.

Google Cloud Storage でのCORSの設定

Posted at

バケットの現在のCORSの設定を取得する

gsutil cors get gs://example

バケットにCORSの設定JSONを食わせる

gsutil cors set cors-json-file.json gs://example

CORS設定のJSONファイル

[
  {
    "origin": [
      "http://localhost:3000",
      "http://www.hoge.com",
      "https://www.hoge.com"
    ],
    "responseHeader": [
              "Content-Type",
              "Accept", 
              "X-Requested-With",
              "Access-Control-Allow-Credentials"
              ],
    "method": [
      "GET",
      "OPTIONS"
    ],
    "maxAgeSeconds": 60
  }
]
20
13
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
20
13