Firebase云功能使用http协议而不是https
我的云功能:Firebase云功能使用http协议而不是https,firebase,express,google-cloud-functions,Firebase,Express,Google Cloud Functions,我的云功能: const functions = require('firebase-functions'); exports.test = functions.https.onRequest((req, res) => { console.log('req protocol: ' + req.protocol + ', secure: ' + req.secure); res.send('test'); }); 当我部署它时,我会得到一个URL链接来触发它,如下所示:
const functions = require('firebase-functions');
exports.test = functions.https.onRequest((req, res) => {
console.log('req protocol: ' + req.protocol + ', secure: ' + req.secure);
res.send('test');
});
当我部署它时,我会得到一个URL链接来触发它,如下所示:
https://{...}.cloudfunctions.net/test
我在浏览器中打开此链接,即触发该功能,并在Firebase控制台日志中看到:
请您向我解释一下,为什么请求的协议不是“https”
p、 这让我很困惑,因为我需要从客户端发送带有敏感信息的http请求,我想使用
https
协议来实现这一点 如果我在浏览器中签入,电话就会安全地发出。我的猜测是,流量在被传递到您的云函数代码之前,会在谷歌基础设施的某个地方被解密。@Frank van Puffelen:谢谢,我想我现在安全了。