最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

content security policy - Is there any google documentation stated about that value should add to CSP directive 'correct

programmeradmin5浏览0评论

I had implemented google recaptcha at my website and the website using Content-Security-Policy (CSP). According to google documentation, we should add following values to the directives which I already done for it.

script-src /, /
frame-src /, /

default-src 'self';
script-src 'self' *.googleapis *.gstatic *.google;
style-src 'self' 'unsafe-inline' *.googleapis *.gstatic www.google;
img-src 'self' *.gstatic *.google-analytics *.google *.google.sg; 
font-src 'self' fonts.gstatic; 
frame-src 'self' www.google www.gstatic; 
connect-src accounts.google *.google-analytics ;

As a result, google recaptcha was able to render and working. But browser devtools console indicated there was an error of violate CSP directives of connect-src.

google recaptcha

Anyone having this issue before? Is it my code issue or misconfiguration anything? Shall I just add the value to connect-src directive? If yes, is there any document stated that value should be add to connect-src?

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论