I'm trying to create a Google Cloud Function (GCF) that check if a requested header is added then continue working.
The GCF is working on:
https://us-central1-*******.cloudfunctions.net/NowShowing
normally, but if we add a custom domain
https://******.firebaseapp.com
and run the Cloud Function
https://******.firebaseapp.com/NowShowing
, the Cloud Function is not getting the requested header and it is not working
exports.NowShowing = functions.https.onRequest((request, response) => {
cors(request, response, () => {
if (request.header('_api_key') == "whatever") {
// code
}
})
})
any idea how to be fixed