本文介绍了Firebase Cloud Functions https.onCall完成,状态码:204的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Firebase函数
const functions = require('firebase-functions');
const admin = require('firebase-admin');
const cors = require('cors')({ origin: true });
exports.addMessage = functions.https.onCall((data, context) => {
return { text: "Test" };
});
问题
问题是,当我从应用程序调用此函数时,我首先获得状态码:204 ,然后完成状态码:200
The problem is when i call this function from the app i first get finished with status code: 204 and after that finished with status code: 200
我该如何预防?
推荐答案
这是正常现象,您不应采取任何措施防止它。导致204的第一个请求是CORS执行
这篇关于Firebase Cloud Functions https.onCall完成,状态码:204的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!