Firebase cloud functions incorrect header check

◇◆丶佛笑我妖孽 提交于 2020-01-03 00:52:08

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!