我为HTTP Content-Security-Policy设置了img-src
指令,该指令指定了允许在我的网站上使用的图像和图标的有效来源。 另外我设置了Google分析。 以下是指令的值: img-src 'self' data: www.google-analytics.com https://www.google.com/pagead/
问题是Google切换到访问者的国家/地区域,因此它会尝试从该域中加载不是来自www.google.com的特殊服务映像。例如。如果我访问意大利网站(google.com => google.it),它会在浏览器控制台抱怨:来自不同域域的内容Secuty策略和Google Analytics(分析)图像
Refused to load the image 'https://www.google.it/ads/ga-audiences?v=1&aip=1&t=sr&_r=4&tid=UA-1234…' because it violates the following Content Security Policy directive: "img-src 'self' data: www.google-analytics.com https://www.google.com/pagead/".
有什么办法如何计算在IMG Google.com的所有可能的域区-src指令?据我所知,写一些类似于“google。*”的东西是不可能的。 Google Analytics可能有一些解决方案吗?