Skip to content

Instantly share code, notes, and snippets.

@lukas-h
Created December 5, 2019 01:57
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lukas-h/1f0fd8c6111140f6f6814fbea5563a35 to your computer and use it in GitHub Desktop.
Save lukas-h/1f0fd8c6111140f6f6814fbea5563a35 to your computer and use it in GitHub Desktop.
my firebase hosting config file
{
"hosting": {
"public": "_site",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"headers": [{
"source": "**",
"headers": [{
"key": "Access-Control-Allow-Origin",
"value": "*"
}, {
"key": "Access-Control-Allow-Credentials",
"value": "true"
}, {
"key": "Access-Control-Allow-Headers",
"value": "Access-Control-Allow-Origin, Access-Control-Allow-Credentials"
}]
}, {
"source": "**/*.@(jpg|jpeg|gif|png)",
"headers": [{
"key": "Cache-Control",
"value": "max-age=7200"
}]
}],
"redirects": [{
"source": "/amp/news/:post*",
"destination": "https://example.com/news/:post*",
"type": 301
}
]
}
}
@graemejcox
Copy link

graemejcox commented Jan 31, 2022

This may help me solve some cors problems. Thanks

@frantovar
Copy link

Thanks. It solve cors problems too :)

@akuma0
Copy link

akuma0 commented Sep 28, 2022

Thanks you !
2 days i'm stuck and you solve my cors problem !

Edit : Works few hours only... Didn't work anymore

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment