Has anyone found a way to set the mime type returned in the Content-Type header when hosting a file using Firebase Hosting? The docs say they support some headers in their rules file but not the content-type and I tied it anyway but fails the 'firebase deploy' due to error 'hosting.headers[0].headers[0].key is not one of enum values'. Also, the file i need to serve cannot have an extension which makes things harder for firebase to auto discover the type of the file.
I tested this and it seems to work. Also for your second issue why not set an extension anyways but change it to the mimetype you need?
{
"database": {
"rules": "database.rules.json"
},
"hosting": {
"public": "public",
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
],
"headers": [
{
"source": "**/*.@(datagz|memgz|mem|data)",
"headers": [
{
"key": "Content-Type",
"value": "application/octet-stream"
}
]
}
]
}
}
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