【发布时间】:2019-04-07 11:53:50
【问题描述】:
我有一个提供 GET 请求的 Apps Script Web 应用程序(通过doGet)。我想确保仅从我的网站调用它,例如我想要一种方法来验证请求。但是,在 Apps 脚本中无法访问文档对象,因此我无法检查 document.referrer。如何访问请求的来源?
如果无法做到这一点,是否有任何方法可以授权仅从我的网站提供请求并拒绝其他请求?我正在使用 ajax 发出请求。
【问题讨论】:
-
window.location.ancestorOrigins但仅限于 chrome。
标签: google-apps-script web-applications get