Post 请求 firebase 云函数给出错误 500

Post request to the firebase cloud functions gives error 500

我有一个 POST 请求到 Firebase 上的 Cloud Functions。当我尝试发出请求时,我收到 CORS 策略错误。好的,我设置模式:'no-cors' 并得到 Failed to load resource: the server responded with a status of 500 ().

这是代码

 let myHeaders = new Headers();
 myHeaders.append("Content-Type", "application/json");
 myHeaders.append("Accept", "application/json");

 let raw = JSON.stringify({
    "description": "Test item",
    "email": "testemail@gmail.com"
 });

 let requestOptions = {
    method: 'POST',
    headers: myHeaders,
    body: raw,
    mode: 'no-cors',
    redirect: 'follow',
 };

 fetch("https://someURl.cloudfunctions.net/someRequest", requestOptions)
 .then(response => response.text())
 .then(result => console.log(result))
 .catch(error => console.log('error', error));

代码复制自Postman

有什么想法吗?

jaba, the issue was on server side. Also, same has been documented here确认。