Setting the bucket CORS header

Some browser operations require the domain to be whitelisted by the CORS header. We setup firebase to whitelist our domain by providing a cors.json config file to gsutil or gcloud storage.

[
    {
        "origin": ["https://imagetales.io", "http://localhost:5173"],
        "method": ["GET"],
        "maxAgeSeconds": 3600
    }
]
gsutil cors set cors.json gs://imagetales.firebasestorage.app

gcloud storage buckets update gs://imagetales.firebasestorage.app --cors-file=cors.json

gcloud storage buckets describe gs://imagetales.firebasestorage.app --format="default(cors_config)" # describe the bucket cors config
earlymorning logo

© 2025 - All rights reserved

Setting the bucket CORS header

Some browser operations require the domain to be whitelisted by the CORS header. We setup firebase to whitelist our domain by providing a cors.json config file to gsutil or gcloud storage.

[
    {
        "origin": ["https://imagetales.io", "http://localhost:5173"],
        "method": ["GET"],
        "maxAgeSeconds": 3600
    }
]
gsutil cors set cors.json gs://imagetales.firebasestorage.app

gcloud storage buckets update gs://imagetales.firebasestorage.app --cors-file=cors.json

gcloud storage buckets describe gs://imagetales.firebasestorage.app --format="default(cors_config)" # describe the bucket cors config