我不明白url白名单限制的概念。本文档API表示不允许未在此列表中列出的每个 url。在应用程序中,我必须使用“jQuery.sap.addUrlWhitelist”将 url 添加到白名单对象,但每个人都可以在运行时添加恶意 url。那么这个概念有什么好处呢?
最佳答案
来自文档:
To allow that the OpenUI5 application is embedded in cross-origin domains, configure a whitelist service. The whitelist service checks whether the application can run in the parent origin, or not.
这是我发现的唯一一个将白名单作为合理示例提及的内容。例如,您可以在嵌入式应用程序中显示自定义“不允许的消息/ View ”。所以好处是你可以以正确的方式对不允许的嵌入使用react
但正如评论中已经提到的,它是一种客户端机制,它总是不安全的,因为它是在浏览器中执行的。但在某些情况下,它可能会节省与服务器的往返时间
这里是文档的链接:https://openui5beta.hana.ondemand.com/#docs/guide/62d9c4d8f5ad49aa914624af9551beb7.html
关于security - SAPUI5 url白名单概念,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35436946/