Created
September 13, 2018 02:25
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"hosting": { | |
"rewrites": [ | |
{"source": "**", "function": "handler"} | |
] | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ./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