Below is my simple firebase.json. If I read the docs right it should tag all files with 'Access-Control-Allow-Origin'. Unfortunately none of the files are being tagged resulting in the error:
Imported resource from origin 'https://gaspush.firebaseapp.com' has been blocked from loading by Cross-Origin Resource Sharing policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
Could someone take a look and let me know how to properly allow all files to all endpoints?
{
"firebase": "gaspush",
"headers": [ {
"source" : “**”,
"headers" : [ {
"key" : "Access-Control-Allow-Origin",
"value" : "*"
} ]
} ],
"public": ".",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
]
}
This is maybe no longer relevant to the original question, but I ran into a similar issue with the new version of Firebase. I had accidentally placed "headers"
section outside of the "hosting"
key.
The below snippet worked for me.
"hosting": {
"public": ".",
"headers": [ {
"source" : "**",
"headers" : [{
"key" : "Access-Control-Allow-Origin",
"value" : "*"
}]
}]
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With