According to Google Cloud Docs
Cross Origin Resource Sharing (CORS) allows interactions between resources from different origins, something that is normally prohibited in order to prevent malicious behavior.
Following the firebase docs, here is how to solve this:
- Download
gsutil
, a Google Cloud CLI, instructions on how to install can be found here.
- Create
cors.json
file with the following content:
[
{
"origin": ["*"],
"method": ["GET"],
"maxAgeSeconds": 3600
}
]
- Now use the CLI to deploy
cors.json
rules using this command:
gsutil cors set cors.json gs://<your-cloud-storage-bucket>
You can find the path for your Firebase storage bucket in Firebase console under Storage feature.