Created
November 8, 2023 23:57
-
-
Save ricardoleme/3b1c21645ed092235b6f70aea2181c77 to your computer and use it in GitHub Desktop.
Set up CORS for Google Cloud Storage Bucket
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Para listar o Bucket name: | |
gsutil ls | |
#Definindo as regras de acesso | |
echo '[{"origin": ["*"],"responseHeader": ["Content-Type"],"method": ["GET", "HEAD"],"maxAgeSeconds": 3600}]' > cors-config.json | |
#Setando as configurações no Bucket | |
gsutil cors set cors-config.json gs://YOUR_BUCKET_NAME | |
#Visualizando as configurações | |
gsutil cors get gs://YOUR_BUCKET_NAME |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
rules_version = '2';
service firebase.storage {
match /b/{bucket}/o {
match /{allPaths=**} {
allow read: if request.method == "GET";
allow write: if request.auth != null;
match /clientes/{imageName} {
allow read;
}
match /imagens/{imageName} {
allow read;
}
}
}
}