内容安全策略:页面设置阻止了https://www.google.com/recaptcha/api2/的加载。

发布于 2025-01-25 17:22:51 字数 848 浏览 1 评论 0原文

尝试加载验证码时,我会收到此错误。我只有当我添加 https://www.google.com/ 我的CSP的一部分。我担心的是,我对Google.com的开放率太大。我的问题是,除了 https://www.google.com/recaptcha 和 https://www.google.com/

此默认SRC块不起作用,并显示此错误

内容安全性策略:该页面的设置阻止了 https://www.google.com/recaptcha/api2/.....

 "default-src 'self'  https://www.google.com/recpatcha/;

此默认SRC块确实有效

 "default-src 'self'  https://www.google.com/recpatcha/ https://www.google.com/;

I receive this error when trying to load a captcha. I can only resolve this when I add https://www.google.com/ to the default-src part of my CSP. My concern is that I'm leaving too wide of an opening to anything with google.com. My question is, could I add a more specific URL other than https://www.google.com/recaptcha and https://www.google.com/ ?

This default-src block does not work and shows this error

Content Security Policy: The page’s settings blocked the loading of a resource at https://www.google.com/recaptcha/api2/......

 "default-src 'self'  https://www.google.com/recpatcha/;

This default-src block does work

 "default-src 'self'  https://www.google.com/recpatcha/ https://www.google.com/;

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文