我正在尝试在 firebase 托管上存储我的用户配置文件的图像。目前,这些文件托管在 S3 上,这很好,但我意识到 Firebase 带有 10gigs 的免费托管。尝试上传到我的网站时出现 CORS 错误。有人可以让我知道需要在我的 firebase.json 文件中设置哪些配置以允许上传到特定目录。myfirebase10.firebaseapp.com/img
"firebase": "myfirebase10",
"public": "app",
"ignore": [
"firebase.json",
".*",
"**/node_modules/**"
],
"headers": [ {
"source" : "**/*.@(eot|otf|ttf|ttc|woff|font.css)",
"headers" : [ {
"key" : "Access-Control-Allow-Origin",
"value" : "*"
} ]
}, {
"source" : "**/*.@(jpg|jpeg|gif|png)",
"destination": "/img",
"headers" : [ {
"key" : "Access-Control-Allow-Origin",
"value" : "*"
} ]
}, {
"source" : "404.html",
"headers" : [ {
"key" : "Cache-Control",
"value" : "max-age=300"
} ]
} ]
}