您如何使Google Cloud Functions仅在从某些URL ping时才起作用? [英] How do you made Google Cloud Functions only worked when pinged from certain URLS?

查看:97
本文介绍了您如何使Google Cloud Functions仅在从某些URL ping时才起作用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我做了一个Google Cloud函数,但是即使我在隐身窗口中键入URL,它也会返回数据.如何使我的Google Cloud功能仅可用于myWebsite.com或localhost?

I made a Google Cloud function, but it returns data even when I type in the URL in an incognito window. How do I make my Google Cloud functions only available for myWebsite.com or localhost?

推荐答案

这不可能完全实施.创建HTTP端点时,应该期望可以从任何地方访问它,并且访问的标题可能与网络浏览器通常发送的标题不匹配.

This is not possible to fully enforce. When you make an HTTP endpoint, you should expect that it could be accessed from anywhere, and that the access may have headers that do not match what a web browser would normally send.

这篇关于您如何使Google Cloud Functions仅在从某些URL ping时才起作用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆