问题
I am trying to receive a call to the Firebase Cloud Function and previously I was able to GET, but now I am unable to POST:
body:
<some valid json>
headers:
Accept: */*
Accept-Encoding: gzip, deflate
Connection: keep-alive
Content-Encoding: gzip
Content-Length: 1296
Content-Type: application/json
User-Agent: python-requests/2.9.1
this is what I see in the firebase log
Error: incorrect header check at Zlib._handle.onerror (zlib.js:370:17)
I also see this:
Billing account not configured. External network is not accessible and quotas are severely limited. Configure billing account to remove these restrictions
I made 45 calls so far out of 125.000 a month that's available in the Spark (Free) plan. So I am nowhere near to the limit. Nor am I making outgoing requests, just Firebase Database operations.
Another strange fact is that I am unable to see output of console.log("hello world");
from the cloud code function in the firebase console. I know the Cloud function is being called, I see that in the log.
Does it mean that the encoding is not accepted by the Firebase cloud function? This is an Omnivore API Webhook. If so, then how do I make this work if I cannot change the encoding? And if not, what is the issue?
This is the body of the Firebase cloud function:
admin.database().ref('/omnivoreCodes').child(req.body.name).set(req.body.id);
res.status(200).send(`success`);
And it's tested and works when I make a POST request via Postman.
来源:https://stackoverflow.com/questions/46384133/firebase-cloud-functions-incorrect-header-check