quang4dev

GCS get file Error with CORS: CORS Missing Allow Origin

Jan 2nd, 2022 (edited)
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.87 KB | None | 0 0
  1. GCS get file Error with CORS: CORS Missing Allow Origin
  2. 1/ Install Gsuite: https://cloud.google.com/storage/docs/gsutil_install#install
  3. 2/ Login: gcloud auth login
  4. 3/ Get config list: gcloud config configurations list
  5. 4/ Register with new config: gcloud auth configure-docker
  6. 5/ Set default project: gcloud config set project [PROJECT-NAME]
  7. 6/ Set config again: gcloud auth configure-docker
  8. 7/ Configuring cross-origin resource sharing: https://cloud.google.com/storage/docs/configuring-cors
  9. - Create new file, named: cors-json-filetest.json at your local current folderhttps://pastebin.com/
  10. - Allow all with this config
  11. [
  12.     {
  13.       "origin": ["*"],
  14.       "method": ["*"],
  15.       "responseHeader": ["HEADER"],
  16.       "maxAgeSeconds": 30000000
  17.     }
  18. ]
  19. 8/ Set CORS: gsutil cors set cors-json-filetest.json gs://[BULKEE-NAME]
  20. 9/ Check CORS: gsutil cors get gs://[BULKEE-NAME]
  21.  
Advertisement
Add Comment
Please, Sign In to add comment