我已经创建了一个 Azure 服务应用程序。我正在使用网站内容安全策略来保护它。除了当我使用它时,它会阻止我不希望它阻止的东西。
我正在使用 recaptcha,这就是为什么我需要添加谷歌。
我的客户服务提供商:
default-src 'self';
script-src: 'self' https://google.com [my website url];
script-src-elem: 'self' https://google.com [my website url];
令人沮丧的是,我仍然收到以下消息:
The page's settings blocked the loading of a resource at https://www.google.com/recaptcha/api.js?render=6LfWwj4lAAAAAFJ-LTZkzZJNAuQxkiPNMrlD93ai ("script-src-elem").
The page's settings blocked the loading of a resource at [my website url]/lib/bootstrap/dist/js/bootstrap.bundle.min.js ("script-src-elem")
我希望“script-src-elem”行条目能够解决这些错误。
CSP好像没有我想的那么直接。有人知道在这里做什么吗?
更新:这是一个 firefox 问题 :'(