-2

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

sideshowbarker
  • 81,827
  • 26
  • 193
  • 197
allo
  • 83
  • 3
  • 9

1 Answers1

0

I see you already found the answer to your own question. That's true, headers with "_" character are not accepted.

You can see more information here:

what characters are allowed in HTTP header values?

Temu
  • 859
  • 4
  • 11