google-chrome - 谷歌浏览器 SRI 哈希

标签 google-chrome hash subresource-integrity

有没有人在使用 Google Chrome 和 SRI Hash 时遇到过这个问题,它一直在控制台窗口中抛出相同的错误:

Failed to find a valid digest in the 'integrity' attribute for resource 'https://fonts.googleapis.com/css?family=Indie+Flower' with computed SHA-256 integrity 'yxJPuU/cJi0/8FoS+agssT/MtC4P3SGuU+JOzbTejqQ='. The resource has been blocked.



我正在从 https://report-uri.io/home/sri_hash 生成代码并且也尝试过 https://www.srihash.org/

根据这个网站 https://glebbahmutov.com/blog/subresource-integrity/ 作者有同样的问题,所以添加了多个哈希值,这就是我所拥有的 <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Indie+Flower" integrity="sha256-CoGIUDlbZltnYk6u/wQKXOszdOOWImA1XzSERnNzHlc= sha384-vk+perBz0d5g0G+x7+4BxElvHeiaLNX7jegOI63Bg53TxNYaUzLGEsSQ4AmIwVr4 sha512-h+9Z3+9s3jtPJjXU9phAXFQwYYFSYhXlnkPwkuubLFf5kfeXWIRC32YkRdB08xmut/dJG/RjPoiR/r4DAtm3PQ==" crossorigin="anonymous">

最佳答案

这必须处理 Google 字体根据浏览器提供不同文件的事实。因此,它会根据用户使用的浏览器进行不同的哈希处理。

以下是 Google 提供的一些关于他们是否会调整系统以支持它的信息。 https://github.com/google/fonts/issues/473

关于google-chrome - 谷歌浏览器 SRI 哈希,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44043585/

相关文章:

jquery - NotAllowedError : Must be handling a user gesture to perform a share request. navigator.share

javascript - 从 Chrome 扩展发送 AJAX

c# - 哪种算法更适合散列密码 C#?

javascript - 使用 javascript 实现图像的子资源完整性

attributes - 如何使用 SRI 哈希和 "onload"属性

css - 使用 CSS column-count 并不能仅平衡 Chrome 中的内容

jquery - 为什么我的 jquery 在 jsFiddle 上可以工作,但在我的 localHost 上却不行?

ruby - 在 Ruby 中返回具有修改值的散列

c++ - 算法识别字符串匹配散列和无误报

javascript - PHP 中的子资源完整性和缓存破坏技术