Chrome shows CORS error for GCS but file gets uploaded

37 Views Asked by At

I am trying to upload a file to GCS by making a PUT request to a signed URL. The CORS configuration of my bucket is

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

This is the response of preflight enter image description here

But chrome shows CORS error in console while making the actual PUT request. enter image description here

Now the interesting part is that the file is actually getting uploaded to the bucket!

I am confused as to what exactly is happening here and why is chrome showing CORS error in the console when the file upload is working correctly.

1

There are 1 best solutions below

2
Ronnie Royston On

I think your origin is misconfigured.

Try :

"origin":"*",