Skip to content

Instantly share code, notes, and snippets.

@corpulentcoffee
Created September 13, 2018 02:25
Show Gist options
  • Save corpulentcoffee/f66852da5e48b1a49c21893f7d0bce9e to your computer and use it in GitHub Desktop.
Save corpulentcoffee/f66852da5e48b1a49c21893f7d0bce9e to your computer and use it in GitHub Desktop.
Example for wiring up a Firebase function and returning an STS header for HSTS preloading
{
"hosting": {
"rewrites": [
{"source": "**", "function": "handler"}
]
}
}
// ./functions/index.js
const functions = require('firebase-functions');
exports.handler = functions.https.onRequest((request, response) => {
response.set('Strict-Transport-Security', 'max-age=63072000; includeSubDomains; preload');
// . . .
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment