Enabling CORS for google cloud function hosted on google cloud storage

Viewed 294

Using Google cloud function i have hosted a static website ,I made a cloud function too but I need to invoke it using xmlhttp using javascript

This is what I have followed: https://cloud.google.com/storage/docs/configuring-cors

gsutil cors get gs://<My Bucket Name>

I updated the origin url to * .

Gives me the response I needed:

[
  {
   "maxAgeSeconds": 3600,
   "method": ["GET"],
   "origin": ["*"],
   "responseHeader": ["Content-Type"]
  }
]

Even tried with this config:

[
    {
      "origin": ["*"],
      "method": ["*"]
    }
]

Here is what i found on the network tab which looks perfect .

enter image description here

I tried to even clear the cache but it gives me the same CORS error .

enter image description here

0 Answers
Related