Set up and view CORS configurations

Overview Configuration samples

Cross Origin Resource Sharing (CORS) allows interactions between resources from different origins, something that is normally prohibited in order to prevent malicious behavior. Use this page to learn how to set a CORS configuration on a Cloud Storage bucket and how to view the CORS configuration set on a bucket. See Configuration examples for CORS for example CORS configurations, including the configuration that disables any existing configuration on your bucket.

Required roles

To get the permissions that you need to set and view the CORS configuration on a bucket, ask your administrator to grant you the Storage Admin ( roles/storage.admin ) role on the bucket.

This predefined role contains the permissions required to set and view CORS configurations. To see the exact permissions that are required, expand the Required permissionssection:

Required permissions

  • storage.buckets.get
  • storage.buckets.update

You can also get these permissions with other predefined roles or custom roles .

For information about granting roles on buckets, see Use IAM with buckets .

Set the CORS configuration on a bucket

You set a CORS configuration on a bucket by specifying information, such as HTTP methods and originating domains, that identify the types of requests the bucket can accept.

Use the following steps to set a CORS configuration on your bucket:

Console

You cannot manage CORS using the Google Cloud console. Use the gcloud CLI instead.

Command line

  1. Create a JSON file with the CORS configuration you would like to apply. See configuration examples for sample JSON files.

  2. Use the gcloud storage buckets update command with the --cors-file flag:

    gcloud storage buckets update gs:// BUCKET_NAME 
    --cors-file= CORS_CONFIG_FILE 
    

    Where:

    • BUCKET_NAME is the name of the relevant bucket. For example, my-bucket .
    • CORS_CONFIG_FILE is the path to the JSON file you created in Step 1.

Client libraries

C++

For more information, see the Cloud Storage C++ API reference documentation .

To authenticate to Cloud Storage, set up Application Default Credentials. For more information, see Set up authentication for client libraries .

The following sample sets a CORS configuration on a bucket:

  namespace 
  
 gcs 
  
 = 
  
 :: 
 google 
 :: 
 cloud 
 :: 
 storage 
 ; 
 using 
  
 :: 
 google 
 :: 
 cloud 
 :: 
 StatusOr 
 ; 
 []( 
 gcs 
 :: 
 Client 
  
 client 
 , 
  
 std 
 :: 
 string 
  
 const 
&  
 bucket_name 
 , 
  
 std 
 :: 
 string 
  
 const 
&  
 origin 
 ) 
  
 { 
  
 StatusOr<gcs 
 :: 
 BucketMetadata 
>  
 original 
  
 = 
  
 client 
 . 
 GetBucketMetadata 
 ( 
 bucket_name 
 ); 
  
 if 
  
 ( 
 ! 
 original 
 ) 
  
 throw 
  
 std 
 :: 
 move 
 ( 
 original 
 ). 
 status 
 (); 
  
 std 
 :: 
 vector<gcs 
 :: 
 CorsEntry 
>  
 cors_configuration 
 ; 
  
 cors_configuration 
 . 
 emplace_back 
 ( 
  
 gcs 
 :: 
 CorsEntry 
 { 
 3600 
 , 
  
 { 
 "GET" 
 }, 
  
 { 
 origin 
 }, 
  
 { 
 "Content-Type" 
 }}); 
  
 StatusOr<gcs 
 :: 
 BucketMetadata 
>  
 patched 
  
 = 
  
 client 
 . 
 PatchBucket 
 ( 
  
 bucket_name 
 , 
  
 gcs 
 :: 
 BucketMetadataPatchBuilder 
 (). 
 SetCors 
 ( 
 cors_configuration 
 ), 
  
 gcs 
 :: 
 IfMetagenerationMatch 
 ( 
 original 
 - 
> metageneration 
 ())); 
  
 if 
  
 ( 
 ! 
 patched 
 ) 
  
 throw 
  
 std 
 :: 
 move 
 ( 
 patched 
 ). 
 status 
 (); 
  
 if 
  
 ( 
 patched 
 - 
> cors 
 (). 
 empty 
 ()) 
  
 { 
  
 std 
 :: 
 cout 
 << 
 "Cors configuration is not set for bucket " 
 << 
 patched 
 - 
> name 
 () 
 << 
 " 
 \n 
 " 
 ; 
  
 return 
 ; 
  
 } 
  
 std 
 :: 
 cout 
 << 
 "Cors configuration successfully set for bucket " 
 << 
 patched 
 - 
> name 
 () 
 << 
 " 
 \n 
 New cors configuration: " 
 ; 
  
 for 
  
 ( 
 auto 
  
 const 
&  
 cors_entry 
  
 : 
  
 patched 
 - 
> cors 
 ()) 
  
 { 
  
 std 
 :: 
 cout 
 << 
 " 
 \n 
 " 
 << 
 cors_entry 
 << 
 " 
 \n 
 " 
 ; 
  
 } 
 } 
 

C#

For more information, see the Cloud Storage C# API reference documentation .

To authenticate to Cloud Storage, set up Application Default Credentials. For more information, see Set up authentication for client libraries .

The following sample sets a CORS configuration on a bucket:

  using 
  
 Google.Apis.Storage.v1.Data 
 ; 
 using 
  
  Google.Cloud.Storage.V1 
 
 ; 
 using 
  
 System 
 ; 
 using 
  
 System.Collections.Generic 
 ; 
 using 
  
 static 
  
 Google 
 . 
 Apis 
 . 
 Storage 
 . 
 v1 
 . 
 Data 
 . 
 Bucket 
 ; 
 public 
  
 class 
  
 BucketAddCorsConfigurationSample 
 { 
  
 public 
  
 Bucket 
  
 BucketAddCorsConfiguration 
 ( 
 string 
  
 bucketName 
  
 = 
  
 "your-bucket-name" 
 ) 
  
 { 
  
 var 
  
 storage 
  
 = 
  
  StorageClient 
 
 . 
  Create 
 
 (); 
  
 var 
  
 bucket 
  
 = 
  
 storage 
 . 
 GetBucket 
 ( 
 bucketName 
 ); 
  
 CorsData 
  
 corsData 
  
 = 
  
 new 
  
 CorsData 
  
 { 
  
 Origin 
  
 = 
  
 new 
  
 string 
 [] 
  
 { 
  
 "*" 
  
 }, 
  
 ResponseHeader 
  
 = 
  
 new 
  
 string 
 [] 
  
 { 
  
 "Content-Type" 
 , 
  
 "x-goog-resumable" 
  
 }, 
  
 Method 
  
 = 
  
 new 
  
 string 
 [] 
  
 { 
  
 "PUT" 
 , 
  
 "POST" 
  
 }, 
  
 MaxAgeSeconds 
  
 = 
  
 3600 
  
 //One Hour 
  
 }; 
  
 if 
  
 ( 
 bucket 
 . 
 Cors 
  
 == 
  
 null 
 ) 
  
 { 
  
 bucket 
 . 
 Cors 
  
 = 
  
 new 
  
 List<CorsData> 
 (); 
  
 } 
  
 bucket 
 . 
 Cors 
 . 
 Add 
 ( 
 corsData 
 ); 
  
 bucket 
  
 = 
  
 storage 
 . 
 UpdateBucket 
 ( 
 bucket 
 ); 
  
 Console 
 . 
 WriteLine 
 ( 
 $"bucketName {bucketName} was updated with a CORS config to allow {string.Join(" 
 , 
 ", corsData.Method)} requests from" 
  
 + 
  
 $" {string.Join(" 
 , 
 ", corsData. Origin 
)} sharing {string.Join(" 
 , 
 ", corsData.ResponseHeader)} responseHeader" 
  
 + 
  
 $" responses across origins." 
 ); 
  
 return 
  
 bucket 
 ; 
  
 } 
 } 
 

Go

For more information, see the Cloud Storage Go API reference documentation .

To authenticate to Cloud Storage, set up Application Default Credentials. For more information, see Set up authentication for client libraries .

The following sample sets a CORS configuration on a bucket:

  import 
  
 ( 
  
 "context" 
  
 "fmt" 
  
 "io" 
  
 "time" 
  
 "cloud.google.com/go/storage" 
 ) 
 // setBucketCORSConfiguration sets a CORS configuration on a bucket. 
 func 
  
 setBucketCORSConfiguration 
 ( 
 w 
  
 io 
 . 
  Writer 
 
 , 
  
 bucketName 
  
 string 
 , 
  
 maxAge 
  
 time 
 . 
 Duration 
 , 
  
 methods 
 , 
  
 origins 
 , 
  
 responseHeaders 
  
 [] 
 string 
 ) 
  
 error 
  
 { 
  
 // bucketName := "bucket-name" 
  
 // maxAge := time.Hour 
  
 // methods := []string{"GET"} 
  
 // origins := []string{"some-origin.com"} 
  
 // responseHeaders := []string{"Content-Type"} 
  
 ctx 
  
 := 
  
 context 
 . 
 Background 
 () 
  
 client 
 , 
  
 err 
  
 := 
  
 storage 
 . 
 NewClient 
 ( 
 ctx 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 return 
  
 fmt 
 . 
 Errorf 
 ( 
 "storage.NewClient: %w" 
 , 
  
 err 
 ) 
  
 } 
  
 defer 
  
 client 
 . 
 Close 
 () 
  
 ctx 
 , 
  
 cancel 
  
 := 
  
 context 
 . 
 WithTimeout 
 ( 
 ctx 
 , 
  
 time 
 . 
 Second 
 * 
 10 
 ) 
  
 defer 
  
 cancel 
 () 
  
 bucket 
  
 := 
  
 client 
 . 
  Bucket 
 
 ( 
 bucketName 
 ) 
  
 bucketAttrsToUpdate 
  
 := 
  
 storage 
 . 
  BucketAttrsToUpdate 
 
 { 
  
 CORS 
 : 
  
 [] 
 storage 
 . 
  CORS 
 
 { 
  
 { 
  
 MaxAge 
 : 
  
 maxAge 
 , 
  
 Methods 
 : 
  
 methods 
 , 
  
 Origins 
 : 
  
 origins 
 , 
  
 ResponseHeaders 
 : 
  
 responseHeaders 
 , 
  
 }}, 
  
 } 
  
 if 
  
 _ 
 , 
  
 err 
  
 := 
  
 bucket 
 . 
 Update 
 ( 
 ctx 
 , 
  
 bucketAttrsToUpdate 
 ); 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 return 
  
 fmt 
 . 
 Errorf 
 ( 
 "Bucket(%q).Update: %w" 
 , 
  
 bucketName 
 , 
  
 err 
 ) 
  
 } 
  
 fmt 
 . 
 Fprintf 
 ( 
 w 
 , 
  
 "Bucket %v was updated with a CORS config to allow %v requests from %v sharing %v responses across origins\n" 
 , 
  
 bucketName 
 , 
  
 methods 
 , 
  
 origins 
 , 
  
 responseHeaders 
 ) 
  
 return 
  
 nil 
 } 
 

Java

For more information, see the Cloud Storage Java API reference documentation .

To authenticate to Cloud Storage, set up Application Default Credentials. For more information, see Set up authentication for client libraries .

The following sample sets a CORS configuration on a bucket:

  import 
  
 com.google.cloud.storage. Bucket 
 
 ; 
 import 
  
 com.google.cloud.storage. Cors 
 
 ; 
 import 
  
 com.google.cloud.storage. HttpMethod 
 
 ; 
 import 
  
 com.google.cloud.storage. Storage 
 
 ; 
 import 
  
 com.google.cloud.storage. StorageOptions 
 
 ; 
 import 
  
 com.google.common.collect.ImmutableList 
 ; 
 public 
  
 class 
 ConfigureBucketCors 
  
 { 
  
 public 
  
 static 
  
 void 
  
 configureBucketCors 
 ( 
  
 String 
  
 projectId 
 , 
  
 String 
  
 bucketName 
 , 
  
 String 
  
 origin 
 , 
  
 String 
  
 responseHeader 
 , 
  
 Integer 
  
 maxAgeSeconds 
 ) 
  
 { 
  
 // The ID of your GCP project 
  
 // String projectId = "your-project-id"; 
  
 // The ID of your GCS bucket 
  
 // String bucketName = "your-unique-bucket-name"; 
  
 // The origin for this CORS config to allow requests from 
  
 // String origin = "http://example.appspot.com"; 
  
 // The response header to share across origins 
  
 // String responseHeader = "Content-Type"; 
  
 // The maximum amount of time the browser can make requests before it must repeat preflighted 
  
 // requests 
  
 // Integer maxAgeSeconds = 3600; 
  
  Storage 
 
  
 storage 
  
 = 
  
  StorageOptions 
 
 . 
 newBuilder 
 (). 
 setProjectId 
 ( 
 projectId 
 ). 
 build 
 (). 
  getService 
 
 (); 
  
  Bucket 
 
  
 bucket 
  
 = 
  
 storage 
 . 
  get 
 
 ( 
 bucketName 
 ); 
  
 // See the HttpMethod documentation for other HTTP methods available: 
  
 // https://cloud.google.com/appengine/docs/standard/java/javadoc/com/google/appengine/api/urlfetch/HTTPMethod 
  
  HttpMethod 
 
  
 method 
  
 = 
  
  HttpMethod 
 
 . 
 GET 
 ; 
  
  Cors 
 
  
 cors 
  
 = 
  
  Cors 
 
 . 
 newBuilder 
 () 
  
 . 
  setOrigins 
 
 ( 
 ImmutableList 
 . 
 of 
 ( 
  Cors 
 
 . 
 Origin 
 . 
 of 
 ( 
 origin 
 ))) 
  
 . 
  setMethods 
 
 ( 
 ImmutableList 
 . 
 of 
 ( 
 method 
 )) 
  
 . 
  setResponseHeaders 
 
 ( 
 ImmutableList 
 . 
 of 
 ( 
 responseHeader 
 )) 
  
 . 
  setMaxAgeSeconds 
 
 ( 
 maxAgeSeconds 
 ) 
  
 . 
 build 
 (); 
  
 bucket 
 . 
  toBuilder 
 
 (). 
 setCors 
 ( 
 ImmutableList 
 . 
 of 
 ( 
 cors 
 )). 
 build 
 (). 
 update 
 (); 
  
 System 
 . 
 out 
 . 
 println 
 ( 
  
 "Bucket " 
  
 + 
  
 bucketName 
  
 + 
  
 " was updated with a CORS config to allow GET requests from " 
  
 + 
  
 origin 
  
 + 
  
 " sharing " 
  
 + 
  
 responseHeader 
  
 + 
  
 " responses across origins" 
 ); 
  
 } 
 } 
 

Node.js

For more information, see the Cloud Storage Node.js API reference documentation .

To authenticate to Cloud Storage, set up Application Default Credentials. For more information, see Set up authentication for client libraries .

The following sample sets a CORS configuration on a bucket:

  // Imports the Google Cloud client library 
 const 
  
 { 
 Storage 
 } 
  
 = 
  
 require 
 ( 
 ' @google-cloud/storage 
' 
 ); 
 // Creates a client 
 const 
  
 storage 
  
 = 
  
 new 
  
 Storage 
 (); 
 /** 
 * TODO(developer): Uncomment the following lines before running the sample. 
 */ 
 // The ID of your GCS bucket 
 // const bucketName = 'your-unique-bucket-name'; 
 // The origin for this CORS config to allow requests from 
 // const origin = 'http://example.appspot.com'; 
 // The response header to share across origins 
 // const responseHeader = 'Content-Type'; 
 // The maximum amount of time the browser can make requests before it must 
 // repeat preflighted requests 
 // const maxAgeSeconds = 3600; 
 // The name of the method 
 // See the HttpMethod documentation for other HTTP methods available: 
 // https://cloud.google.com/appengine/docs/standard/java/javadoc/com/google/appengine/api/urlfetch/HTTPMethod 
 // const method = 'GET'; 
 async 
  
 function 
  
 configureBucketCors 
 () 
  
 { 
  
 await 
  
 storage 
 . 
 bucket 
 ( 
 bucketName 
 ). 
  setCorsConfiguration 
 
 ([ 
  
 { 
  
 maxAgeSeconds 
 , 
  
 method 
 : 
  
 [ 
 method 
 ], 
  
 origin 
 : 
  
 [ 
 origin 
 ], 
  
 responseHeader 
 : 
  
 [ 
 responseHeader 
 ], 
  
 }, 
  
 ]); 
  
 console 
 . 
 log 
 ( 
 `Bucket 
 ${ 
 bucketName 
 } 
 was updated with a CORS config 
 to allow 
 ${ 
 method 
 } 
 requests from 
 ${ 
 origin 
 } 
 sharing 
  
 ${ 
 responseHeader 
 } 
 responses across origins` 
 ); 
 } 
 configureBucketCors 
 (). 
 catch 
 ( 
 console 
 . 
 error 
 ); 
 

PHP

For more information, see the Cloud Storage PHP API reference documentation .

To authenticate to Cloud Storage, set up Application Default Credentials. For more information, see Set up authentication for client libraries .

The following sample sets a CORS configuration on a bucket:

  use Google\Cloud\Storage\StorageClient; 
 /** 
 * Update the CORS configuration of a bucket. 
 * 
 * @param string $bucketName The name of your Cloud Storage bucket. 
 *        (e.g. 'my-bucket') 
 * @param string $method The HTTP method for the CORS config. (e.g. 'GET') 
 * @param string $origin The origin from which the CORS config will allow requests. 
 *        (e.g. 'http://example.appspot.com') 
 * @param string $responseHeader The response header to share across origins. 
 *        (e.g. 'Content-Type') 
 * @param int $maxAgeSeconds The maximum amount of time the browser can make 
 *        (e.g. 3600) 
 *     requests before it must repeat preflighted requests. 
 */ 
 function cors_configuration(string $bucketName, string $method, string $origin, string $responseHeader, int $maxAgeSeconds): void 
 { 
 $storage = new StorageClient(); 
 $bucket = $storage->bucket($bucketName); 
 $bucket->update([ 
 'cors' => [ 
 [ 
 'method' => [$method], 
 'origin' => [$origin], 
 'responseHeader' => [$responseHeader], 
 'maxAgeSeconds' => $maxAgeSeconds, 
 ] 
 ] 
 ]); 
 printf( 
 'Bucket %s was updated with a CORS config to allow GET requests from ' . 
 '%s sharing %s responses across origins.', 
 $bucketName, 
 $origin, 
 $responseHeader 
 ); 
 } 
 

Python

For more information, see the Cloud Storage Python API reference documentation .

To authenticate to Cloud Storage, set up Application Default Credentials. For more information, see Set up authentication for client libraries .

The following sample sets a CORS configuration on a bucket:

  from 
  
 google.cloud 
  
 import 
  storage 
 
 def 
  
 cors_configuration 
 ( 
 bucket_name 
 ): 
  
 """Set a bucket's CORS policies configuration.""" 
 # bucket_name = "your-bucket-name" 
 storage_client 
 = 
  storage 
 
 . 
  Client 
 
 () 
 bucket 
 = 
 storage_client 
 . 
  get_bucket 
 
 ( 
 bucket_name 
 ) 
 bucket 
 . 
  cors 
 
 = 
 [ 
 { 
 "origin" 
 : 
 [ 
 "*" 
 ], 
 "responseHeader" 
 : 
 [ 
 "Content-Type" 
 , 
 "x-goog-resumable" 
 ], 
 "method" 
 : 
 [ 
 'PUT' 
 , 
 'POST' 
 ], 
 "maxAgeSeconds" 
 : 
 3600 
 } 
 ] 
 bucket 
 . 
 patch 
 () 
 print 
 ( 
 f 
 "Set CORS policies for bucket 
 { 
 bucket 
 . 
 name 
 } 
 is 
 { 
 bucket 
 . 
  cors 
 
 } 
 " 
 ) 
 return 
 bucket 
 

Ruby

For more information, see the Cloud Storage Ruby API reference documentation .

To authenticate to Cloud Storage, set up Application Default Credentials. For more information, see Set up authentication for client libraries .

The following sample sets a CORS configuration on a bucket:

  def 
  
 cors_configuration 
  
 bucket_name 
 : 
  
 # The ID of your GCS bucket 
  
 # bucket_name = "your-unique-bucket-name" 
  
 require 
  
 "google/cloud/storage" 
  
 storage 
  
 = 
  
 Google 
 :: 
 Cloud 
 :: 
  Storage 
 
 . 
  new 
 
  
 bucket 
  
 = 
  
 storage 
 . 
 bucket 
  
 bucket_name 
  
 bucket 
 . 
 cors 
  
 do 
  
 | 
 c 
 | 
  
 c 
 . 
  add_rule 
 
  
 [ 
 "*" 
 ] 
 , 
  
 [ 
 "PUT" 
 , 
  
 "POST" 
 ] 
 , 
  
 headers 
 : 
  
 [ 
  
 "Content-Type" 
 , 
  
 "x-goog-resumable" 
  
 ] 
 , 
  
 max_age 
 : 
  
 3600 
  
 end 
  
 puts 
  
 "Set CORS policies for bucket 
 #{ 
 bucket_name 
 } 
 " 
 end 
 

REST APIs

JSON API

  1. Have gcloud CLI installed and initialized , which lets you generate an access token for the Authorization header.

  2. Create a JSON file with the CORS configuration you would like to apply. See configuration examples for sample JSON files.

  3. Use cURL to call the JSON API with a PATCH Bucket request:

     curl 
      
     -- 
     reques 
     t 
      
     PATCH 
      
     \ 
      
     'h 
     tt 
     ps 
     : 
     //storage.googleapis.com/storage/v1/b/ BUCKET_NAME 
    ?fields=cors' \ 
      
     -- 
     header 
      
     'Au 
     t 
     horiza 
     t 
     io 
     n 
     : 
      
     Bearer 
      
     $(gcloud 
      
     au 
     t 
     h 
      
     pri 
     nt 
     - 
     access 
     - 
     t 
     oke 
     n 
     )' 
      
     \ 
      
     -- 
     header 
      
     'Co 
     ntent 
     - 
     Type 
     : 
      
     applica 
     t 
     io 
     n 
     /jso 
     n 
     ' 
      
     \ 
      
     -- 
     da 
     ta 
     - 
     bi 
     nar 
     y 
      
     @ CORS_CONFIG_FILE 
     
    

    Where:

    • BUCKET_NAME is the name of the bucket. For example, my-bucket .
    • CORS_CONFIG_FILE is the path to the JSON file you created in Step 2.

XML API

  1. Have gcloud CLI installed and initialized , which lets you generate an access token for the Authorization header.

  2. Create a XML file with the CORS configuration you would like to apply. See configuration examples for sample XML files.

  3. Use cURL to call the XML API with a PUT Bucket request scoped to ?cors :

    curl  
    -X  
    PUT  
    --data-binary  
    @ CORS_CONFIG_FILE 
      
    \
    -H  
    "Authorization:  
    Bearer  
    $(gcloud  
    auth  
    print-access-token)"  
    \
    -H  
    "x-goog-project-id:  
     PROJECT_ID 
    "  
    \
    "https://storage.googleapis.com/ BUCKET_NAME 
    ?cors"

    Where:

    • BUCKET_NAME is the name of the bucket. For example, my-bucket .
    • PROJECT_ID is the ID of the project associated with the bucket. For example, my-project .
    • CORS_CONFIG_FILE is the path to the XML file you created in Step 2.

To remove the CORS configuration for a bucket, set an empty CORS configuration .

View the CORS configuration for a bucket

To view the CORS configuration for a bucket:

Console

You cannot manage CORS using the Google Cloud console. Use the gcloud CLI instead.

Command line

Use the gcloud storage buckets describe command with the --format flag:

gcloud storage buckets describe gs:// BUCKET_NAME 
--format="default(cors_config)"

Where BUCKET_NAME is the name of the bucket whose CORS configuration you want to view. For example, my-bucket .

Client libraries

To view the CORS configuration for a bucket using the client libraries, follow the instructions for displaying a bucket's metadata and look for the CORS field in the response:

REST APIs

JSON API

  1. Have gcloud CLI installed and initialized , which lets you generate an access token for the Authorization header.

  2. Use cURL to call the JSON API with a GET Bucket request:

     curl 
      
     - 
     X 
      
     GET 
      
     \ 
      
     - 
     H 
      
     "Authorization: Bearer $(gcloud auth print-access-token)" 
      
     \ 
      
     "https://storage.googleapis.com/storage/v1/b/ BUCKET_NAME 
    ?fields=cors" 
    

    Where BUCKET_NAME is the name of the bucket whose CORS configuration you want to view. For example, my-bucket .

XML API

  1. Have gcloud CLI installed and initialized , which lets you generate an access token for the Authorization header.

  2. Use cURL to call the XML API with a GET Bucket request scoped to ?cors :

    curl  
    -X  
    GET  
    \  
    -H  
    "Authorization:  
    Bearer  
    $(gcloud  
    auth  
    print-access-token)"  
    \  
    "https://storage.googleapis.com/ BUCKET_NAME 
    ?cors"

    Where BUCKET_NAME is the name of the bucket whose CORS configuration you want to view. For example, my-bucket .

What's next

Design a Mobile Site
View Site in Mobile | Classic
Share by: